-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from EyeSeeTea/development
Release 0.2.0
- Loading branch information
Showing
87 changed files
with
23,680 additions
and
10,865 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import IndicatorsPage from "../support/pages/indicators-page"; | ||
import { selectInMultiSelector } from "../support/utils"; | ||
|
||
describe("Projects - Indicators", () => { | ||
before(() => { | ||
cy.login("admin"); | ||
cy.loadPage(); | ||
cy.contains("00Cypress Project").trigger("contextmenu"); | ||
cy.contains("Edit").click(); | ||
}); | ||
|
||
it("selects indicators with dependencies", () => { | ||
cy.contains("Sectors").click(); | ||
selectInMultiSelector("sectors", "Protection"); | ||
selectInMultiSelector("sectors", "Food"); | ||
selectInMultiSelector("sectors", "Nutrition"); | ||
cy.contains("Next").click(); | ||
|
||
new IndicatorsPage(cy) | ||
.selectSector("Agriculture") | ||
// De-select initial indicator | ||
.assertExactSelected(["B010200"]) | ||
.unselect("B010200") | ||
.assertExactSelected([]) | ||
|
||
// Select an unpaired benefit sub -> automatic selection of its global in series | ||
.select("B010201") | ||
.assertSelected(["B010201", "B010200"]) | ||
|
||
// Select an paired benefit sub -> automatic selection of its global in series and their paired | ||
.select("B010301") | ||
.assertSelected(["B010301", "B010300", "P010401", "P010400"]) | ||
|
||
// Select a cross-sectorial -> select its series in current sector | ||
.select("P020105") | ||
.assertSelected(["P020105", "P010100"]) | ||
|
||
// Finally check that only the expected indicators are selected | ||
.assertExactSelected([ | ||
...["B010201", "B010200", "B010301", "B010300", "P010401"], | ||
...["P010400", "P020105", "P010100"], | ||
]) | ||
|
||
.selectSector("Livelihood") | ||
// Check that only the initial indicator is selected. The previous selection | ||
// of Agriculture->P020105 should not have modified the indicators in this section | ||
.assertExactSelected(["P020100"]) | ||
|
||
// Select a global | ||
.select("B020200") | ||
.assertExactSelected(["P020100", "B020200", "P020300"]) | ||
// Unselect the global, as it has no subs selected, it should be unselected | ||
.unselect("B020200") | ||
.assertExactSelected(["P020100"]) | ||
|
||
.selectSector("Agriculture") | ||
// A global with subs cannot be unselected | ||
.unselect("B010200") | ||
.expectSnackbar("Global data elements with selected subs cannot be unselected") | ||
|
||
.selectSector("Protection") | ||
// Select an indicator which has a paired sub indicator, its global should be also selected | ||
.select("B100500") | ||
.assertExactSelected(["B100500", "P100701", "P100700"]) | ||
|
||
.selectSector("Nutrition") | ||
// Select a cross-sectorial indicator which has paired sub indicators in other sectors (Food) | ||
.select("B050102") | ||
.assertExactSelected(["B050102", "P050202", "P040100"]) | ||
|
||
.selectSector("Food") | ||
// Now check the same cross-sectorial indicator in the other sector | ||
.select("B050102") | ||
.assertExactSelected(["B050102", "P050202", "B050100", "P050200"]); | ||
|
||
// MER Indicators | ||
cy.contains("Selection of MER Indicators").click(); | ||
new IndicatorsPage(cy) | ||
.selectSector("Agriculture") | ||
.assertVisible([ | ||
...["B010201", "B010200", "B010301", "B010300", "P010401"], | ||
...["P010400", "P020105", "P010100"], | ||
]) | ||
.selectSector("Livelihood") | ||
.assertVisible(["P020100"]) | ||
.assertExactSelected(["P020100"]); | ||
|
||
// Check indicators info in summary step | ||
cy.contains("Summary and Save").click(); | ||
|
||
// Agriculture | ||
cy.contains("B010201"); | ||
cy.contains("B010200"); | ||
cy.contains("B010301"); | ||
cy.contains("B010300"); | ||
cy.contains("P010401"); | ||
cy.contains("P010400"); | ||
cy.contains("P020105"); | ||
cy.contains("P010100"); | ||
|
||
// Livelihood | ||
cy.contains("P020100 [MER]"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
describe("Projects - Delete", () => { | ||
before(() => { | ||
cy.login("admin"); | ||
cy.loadPage(); | ||
cy.contains("00Cypress Project").trigger("contextmenu"); | ||
cy.contains("Delete").click(); | ||
}); | ||
|
||
it("asks confirmation and deletes", () => { | ||
cy.contains("Are you sure").click(); | ||
cy.contains("Proceed").click(); | ||
|
||
cy.contains("1 projects deleted"); | ||
}); | ||
}); |
Oops, something went wrong.