-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCLOMRS-1026: Add automated tests to View Organisation Sources and Co…
…llections (#741)
- Loading branch information
1 parent
2840ebc
commit da18b22
Showing
5 changed files
with
138 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Feature: Organisation details Page | ||
Background: | ||
Given the user is logged in | ||
|
||
@organisation | ||
Scenario: The user should see all details of the organisation | ||
Given an organization exists | ||
And the user is on the organisation details page | ||
Then the organisation name should be displayed | ||
And the organisation sources should be displayed | ||
And the organisation members should be displayed | ||
And the organisation dictionaries should be displayed | ||
|
||
@organisation | ||
Scenario: The user should see organisation sources | ||
Given an organization exists | ||
And a source exists in the organisation | ||
When the user is on the organisation details page | ||
Then the user should see the organisation source | ||
When the user clicks on the source | ||
Then the user should be on the org source page | ||
|
||
@organisation | ||
Scenario: The user should see organisation dictionary | ||
Given an organization exists | ||
And a dictionary exists in the organisation | ||
When the user is on the organisation details page | ||
Then the user should see the organisation dictionary | ||
When the user clicks on the dictionary | ||
Then the user should be on the org dictionary page |
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
59 changes: 59 additions & 0 deletions
59
cypress/support/step_definitions/organisation/details/details.ts
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,59 @@ | ||
import { Given, Then, When } from "cypress-cucumber-preprocessor/steps"; | ||
import { getOrganisationId } from "../../../utils"; | ||
|
||
Given("an organization exists", () => { | ||
cy.createOrganisation(getOrganisationId()); | ||
}); | ||
|
||
Given("a source exists in the organisation", () => { | ||
cy.createOrgSource(undefined, getOrganisationId()); | ||
}); | ||
|
||
Given("a dictionary exists in the organisation", () => { | ||
cy.createOrgDictionary(undefined, getOrganisationId()); | ||
}); | ||
|
||
Given("the user is on the organisation details page", () => | ||
cy.visit(`/orgs/${getOrganisationId()}/`) | ||
); | ||
|
||
Then("the organisation name should be displayed", () => { | ||
cy.findByText("Details").should("be.visible"); | ||
cy.findByText("Test Organisation", { selector: "span" }).should("be.visible"); | ||
}); | ||
|
||
Then("the organisation sources should be displayed", () => { | ||
cy.findByText("Sources", { selector: "legend" }).should("be.visible"); | ||
}); | ||
|
||
Then("the organisation members should be displayed", () => { | ||
cy.findByText("Members", { selector: "legend" }).should("be.visible"); | ||
}); | ||
|
||
Then("the organisation dictionaries should be displayed", () => { | ||
cy.findByText("Dictionaries", { selector: "legend" }).should("be.visible"); | ||
}); | ||
|
||
Then("the user should see the organisation source", () => { | ||
cy.contains("li", "Test Org Source"); | ||
}); | ||
|
||
When("the user clicks on the source", () => | ||
cy.contains("li", "Test Org Source").get("li > a").click() | ||
); | ||
|
||
Then("the user should be on the org source page", () => | ||
cy.url().should("contain",`/orgs/${getOrganisationId()}/sources/`) | ||
); | ||
|
||
Then("the user should see the organisation dictionary", () => { | ||
cy.contains("li", "Test Org Dictionary"); | ||
}); | ||
|
||
When("the user clicks on the dictionary", () => | ||
cy.contains("li", "Test Org Dictionary").get("li > a").click() | ||
); | ||
|
||
Then("the user should be on the org dictionary page", () => | ||
cy.url().should("contain",`/orgs/${getOrganisationId()}/collections/`) | ||
); |