-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OCLOMRS-970:Automated test for creating a version, releasing it and copy subscriptionURL #724
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4451cb9
OCLOMRS-970:Automated test for creating a version, releasing it and c…
suruchee 4cfbf64
Resolved merge conflict by incorporating utils.ts file
suruchee 5c73ffb
updated with suggestions and update for checking the subscription url…
suruchee 974d5ec
separating into three different test: creating version, releasing it …
suruchee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,42 @@ | ||
Feature: Creating a dictionary version, releasing it and copy subscription URL | ||
Background: | ||
Given the user is logged in | ||
|
||
@dictionary | ||
Scenario: The user should be able to click the button to create a new version | ||
Given a dictionary exists | ||
And the user is on the dictionary page | ||
When the user clicks the create new version button | ||
Then the user should be on the create new version dialog box | ||
|
||
@dictionary | ||
@version | ||
Scenario: The user should be able to create a new version | ||
Given a dictionary exists | ||
And the user clicks on the create new version dialog box | ||
When the user enters the version information | ||
And the user submits the form | ||
Then the new version should be created | ||
|
||
@dictionary | ||
@version | ||
Scenario: The user should be able to release a version | ||
Given a dictionary exists | ||
And a version exists | ||
And the user is on the dictionary page | ||
When the user clicks release status switch | ||
And the release dialog opens | ||
And the user clicks yes button | ||
Then the version should be released | ||
|
||
@dictionary | ||
@version | ||
@released | ||
Scenario: The user should be able to copy subscription URL | ||
Given a dictionary exists | ||
And a version exists | ||
And a version is released | ||
And the user is on the dictionary page | ||
When the user clicks the more actions button | ||
And the user selects the "Copy Subscription URL" menu list item | ||
Then the subscription url should be copied |
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
63 changes: 63 additions & 0 deletions
63
cypress/support/step_definitions/dictionary/createVersion/createVersion.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,63 @@ | ||
import 'cypress-wait-until'; | ||
import { Given, Then, When } from "cypress-cucumber-preprocessor/steps"; | ||
import { getDictionaryId, getUser, getVersionId } from "../../../utils"; | ||
|
||
Given("the user is on the dictionary page", () => { | ||
cy.visit(`/users/${getUser()}/collections/${getDictionaryId()}/`); | ||
cy.findByText("Versions").should("be.visible"); | ||
}); | ||
When("the user clicks the create new version button", () => | ||
cy.findByRole("button", { name: /Create new version/i }).click() | ||
); | ||
Then("the user should be on the create new version dialog box", () => | ||
cy.findByText("Create new version", { selector: "h2" }).should("be.visible") | ||
); | ||
|
||
Given("the user clicks on the create new version dialog box", () => { | ||
cy.visit(`/users/${getUser()}/collections/${getDictionaryId()}/`); | ||
cy.findByRole("button", { name: /Create new version/i }).click(); | ||
cy.findByText("Create new version", { selector: "h2" }).should("be.visible") | ||
}); | ||
When("the user enters the version information", () => { | ||
cy.findByLabelText("ID").type("1"); | ||
cy.get("#released").type("{enter}"); | ||
}); | ||
When("the user submits the form", () =>{ | ||
cy.findByRole("button", { name: /Submit/i }).click(); | ||
} | ||
); | ||
Then("the new version should be created", () => { | ||
cy.get("table").contains("td", "1"); | ||
cy.get('[type="checkbox"]').should("not.be.checked"); | ||
}); | ||
|
||
When("the user clicks release status switch", () =>{ | ||
cy.reload(true); | ||
cy.waitUntil(() => cy.getVersion(getVersionId(), getDictionaryId(), getUser(), false), { timeout: 10000 }); | ||
cy.get('[type="checkbox"]').check(); | ||
} | ||
); | ||
When("the release dialog opens", () => | ||
cy.get("#confirmation-dialog-title").should("be.visible") | ||
); | ||
When("the user clicks yes button", () => cy.findByText(/Yes/i).click()); | ||
Then("the version should be released", () => | ||
cy.get('[type="checkbox"]').should("be.checked") | ||
); | ||
|
||
When("the user clicks the more actions button", () => | ||
cy.findByTitle("More actions").click() | ||
); | ||
When(/the user selects the "(.+)" menu list item/, menuItem => | ||
cy.findByText(menuItem).click() | ||
); | ||
Then("the subscription url should be copied", () => { | ||
cy.window().then(win => { | ||
win.navigator.clipboard.readText().then(text => { | ||
assert.equal( | ||
text, | ||
`/users/${getUser()}/collections/${getDictionaryId()}/${getVersionId()}` | ||
); | ||
}); | ||
}); | ||
}); |
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 | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -26,7 +26,11 @@ export const getDictionaryId = () => Cypress.env("dictionaryId"); | |||||||
export const setDictionaryId = (dictionaryId: string) => | ||||||||
Cypress.env("dictionaryId", dictionaryId); | ||||||||
export const getConceptId = () => Cypress.env("conceptId"); | ||||||||
export const setConceptId = (conceptId: string) => Cypress.env("conceptId", conceptId); | ||||||||
export const setConceptId = (conceptId: string) => | ||||||||
Cypress.env("conceptId", conceptId); | ||||||||
export const getOrganisationId = () => Cypress.env("organisationId"); | ||||||||
export const setOrganisationId = (organisationId: string) => | ||||||||
Cypress.env("organisationId", organisationId); | ||||||||
export const getVersionId = () => Cypress.env("versionId"); | ||||||||
export const setVersionId = (versionId: string) => | ||||||||
Cypress.env("versionId", versionId); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.