Skip to content

Commit

Permalink
Cypress E2E improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
saulipurhonen committed Apr 30, 2021
1 parent 7c4d413 commit 2ba9450
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions cypress/integration/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("Basic e2e", function () {
// Edit saved submission
cy.get("button[type=button]").contains("Edit").click()
cy.get("input[name='descriptor.studyTitle']").should("have.value", "New title")
cy.get("input[name='descriptor.studyTitle']", { timeout: 10000 }).focus().type(" edited")
cy.get("input[name='descriptor.studyTitle']", { timeout: 10000 }).focus().type(" edited").blur()
cy.get("input[name='descriptor.studyTitle']").should("have.value", "New title edited")
cy.get("button[type=button]").contains("Update").click()
cy.get("div[role=alert]").contains("Object updated")
Expand Down Expand Up @@ -93,7 +93,9 @@ describe("Basic e2e", function () {
cy.get("select[name='analysisType.referenceAlignment.assembly']").select("Standard")
cy.get("input[name='analysisType.referenceAlignment.assembly.accessionId']").type("Standard Accession Id")
cy.get("h4").contains("Sequence").parent().children("button").click()
cy.get("input[name='analysisType.referenceAlignment.sequence[0].accessionId']").type("Sequence Standard Accession Id")
cy.get("input[name='analysisType.referenceAlignment.sequence[0].accessionId']").type(
"Sequence Standard Accession Id"
)

// Experiment
cy.get("h2").contains("Experiment Reference").parent().children("button").click()
Expand Down Expand Up @@ -136,7 +138,6 @@ describe("Basic e2e", function () {
cy.get("select[name='files[1].filetype']").select("info")
cy.get("select[name='files[1].checksumMethod']").select("SHA256")
cy.get("input[name='files[1].checksum']").type("c34045c1a1db8d1b3fca8a692198466952daae07eaf6104b4c87ed3b55b6af1b")

})
// Submit form
cy.get("button[type=submit]").contains("Submit").click()
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/errorPages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ describe("catch error codes and display corresponding error page", function () {
)
cy.visit(baseUrl)
cy.get('[alt="CSC Login"]').click()
cy.contains(".MuiAlert-message", "500 Internal Server Error")
cy.contains(".MuiAlert-message", "500 Internal Server Error", { timeout: 10000 })
})
})
5 changes: 2 additions & 3 deletions cypress/integration/objectTitles.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ describe("draft and submitted objects' titles", function () {

// Edit submitted object
cy.get("button[type=button]").contains("Edit").click()
cy.get("input[name='descriptor.studyTitle']").should("have.value", "Test title")
cy.get("input[name='descriptor.studyTitle']").type(" 2").blur()
cy.get("input[name='descriptor.studyTitle']").should("have.value", "Test title").type(" 2").blur()
cy.get("input[name='descriptor.studyTitle']").should("have.value", "Test title 2")
cy.get("button[type=button]").contains("Update").click()
cy.get("button[type=button]").contains("Update", { timeout: 10000 }).click()
cy.get("div[role=alert]").contains("Object updated")

// Check the submitted object has correctly updated displayTitle
Expand Down
5 changes: 5 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ import "./commands"

// Alternatively you can use CommonJS syntax:
// require('./commands')

// Turn off all uncaught exception handling
Cypress.on("uncaught:exception", () => {
return false
})

0 comments on commit 2ba9450

Please sign in to comment.