-
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.
- Loading branch information
Showing
4 changed files
with
101 additions
and
3 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,26 @@ | ||
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, release it and copy subscription URL | ||
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 | ||
When the user clicks release status switch | ||
And the release dialog opens | ||
And the user clicks yes button | ||
Then the version should be released | ||
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
58 changes: 58 additions & 0 deletions
58
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,58 @@ | ||
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.get("h2").contains("Create new version") | ||
); | ||
|
||
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.get("h2").contains("Create new version"); | ||
}); | ||
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.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