Skip to content
Snippets Groups Projects
Commit 458e0a48 authored by François Grand's avatar François Grand
Browse files

test(ci): reduce tests to "calcul de tous les modules de tous les exemples", add logging

refs #531
parent 335f07ad
No related branches found
No related tags found
No related merge requests found
Pipeline #139455 passed
......@@ -63,78 +63,5 @@ install:
test:
stage: test
only:
- tags
- schedules
- web
script:
- npm run e2e
build:
stage: build
only:
- pushes
- tags
- schedules
- web
artifacts:
expire_in: 10 min
paths:
- dist/
script:
- npm run build -- --base-href=/cassiopee/$CI_COMMIT_REF_NAME/
clean-stale-branches:
stage: clean-stale-branches
only:
- pushes
- tags
- web
script:
- ./scripts/remove-stale-branches.sh $DEPLOY_HOST_LOGIN $DEPLOY_URL
deploy:
stage: deploy
only:
- pushes
- tags
- web
dependencies:
- build
script:
# Copie de la branche / du tag
- rsync --delete -a "dist/" "$DEPLOY_HOST_LOGIN:$DEPLOY_URL/$CI_COMMIT_REF_NAME"
deploy-stable:
stage: deploy-stable
only:
variables:
- $CI_COMMIT_REF_NAME == "stable"
dependencies:
- build
script:
# Copie de la branche production
- rsync --delete -a "dist/" "$DEPLOY_HOST_LOGIN:$DEPLOY_STABLE_URL/"
# Modification du dossier base href
- ssh $DEPLOY_HOST_LOGIN "sed -i 's:/cassiopee/stable/:/:g' $DEPLOY_STABLE_URL/index.html"
releases-nightly:
stage: releases-nightly
only:
- schedules
dependencies: []
script:
- npm run release-all
- find release -name "fr.irstea.cassiopee_*.deb" -exec scp "{}" $DEPLOY_HOST_LOGIN:$RELEASES_URL/linux-nightly.deb \;
- find release -name "Cassio*Setup*.exe" -exec scp "{}" $DEPLOY_HOST_LOGIN:$RELEASES_URL/windows-nightly.exe \;
- find release -name "Cassio*-mac.zip" -exec scp "{}" $DEPLOY_HOST_LOGIN:$RELEASES_URL/macos-nightly.zip \;
- find release -name "cassiopee-*.apk" -exec scp "{}" $DEPLOY_HOST_LOGIN:$RELEASES_URL/android-nightly.apk \;
releases-version:
stage: releases-version
only:
variables:
- $CI_COMMIT_REF_NAME =~ /^[0-9]+\.[0-9]+\.[0-9]+$/ # version tag
dependencies: []
script:
- ./scripts/release-version.sh $CI_COMMIT_REF_NAME $DEPLOY_HOST_LOGIN $RELEASES_URL
......@@ -25,11 +25,15 @@ describe("ngHyd − example sessions −", async () => {
sideNav = new SideNav();
});
it("calcul de tous les modules de tous les exemples −", async () => {
fit("calcul de tous les modules de tous les exemples −", async () => {
let nlog = 0;
// disable evil option "empty fields on module creation"
await prefPage.navigateTo();
console.log("step " + nlog); nlog++;
await prefPage.disableEvilEmptyFields();
console.log("step " + nlog); nlog++;
await browser.sleep(200);
console.log("step " + nlog); nlog++;
// for each calculator
let lastExampleFound = true;
......@@ -38,31 +42,41 @@ describe("ngHyd − example sessions −", async () => {
if (i == 0) {
// start page
await navbar.clickNewCalculatorButton();
console.log("start page " + nlog); nlog++;
await browser.sleep(200);
}
else {
// empty session
await navbar.clickMenuButton();
console.log("empty session " + nlog); nlog++;
await browser.sleep(200);
await sideNav.clickNewSessionButton();
await browser.sleep(200);
console.log("new session " + nlog); nlog++;
await browser.sleep(1000);
}
const examples = await element.all(by.css("#examples-list .load-example"));
await browser.sleep(1000);
console.log("get examples " + nlog); nlog++;
if (examples.length > i) {
// click example #i
await examples[i].click();
await browser.sleep(50);
console.log("click examples[" + i + "] " + + nlog); nlog++;
await browser.sleep(1000);
const nbModules = await navbar.getCalculatorEntriesCount();
console.log("entries count " + nlog); nlog++;
for (let j = 0; j < nbModules; j++) {
// select module
await navbar.openNthCalculator(j);
console.log("select calc[" + j + "] " + nlog); nlog++;
await browser.sleep(50);
// calculate module
await calcPage.getCalculateButton().click();
console.log("calculate " + nlog); nlog++;
// check results
const hasResults = await calcPage.hasValidResults();
console.log("check res " + nlog); nlog++;
expect(hasResults).toBe(true, `example ${i + 1}, module ${j + 1} (starting at 1)`);
}
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment