diff --git a/cypress/integration/draft.spec.js b/cypress/integration/draft.spec.js index f5193f219..45569860b 100644 --- a/cypress/integration/draft.spec.js +++ b/cypress/integration/draft.spec.js @@ -50,9 +50,13 @@ describe("Draft operations", function () { // Clear cy.continueFirstDraft() cy.get("input[name='descriptor.studyTitle']") - cy.get("button[type=button]", { timeout: 10000 }).contains("Clear form").click() + cy.get("button[type=button]", { timeout: 10000 }) + .contains("Clear form") + .should("be.visible") + .then($el => $el.click()) // Fill + cy.get("input[name='descriptor.studyTitle']").should("be.visible") cy.get("input[name='descriptor.studyTitle']").type("New title") cy.get("input[name='descriptor.studyTitle']").should("have.value", "New title") cy.get("select[name='descriptor.studyType']").select("Metagenomics") diff --git a/cypress/integration/editForm.spec.js b/cypress/integration/editForm.spec.js index 4a7bfdb29..eec8f4c93 100644 --- a/cypress/integration/editForm.spec.js +++ b/cypress/integration/editForm.spec.js @@ -57,7 +57,10 @@ describe("Populate form and render form elements by object data", function () { // Clear object in state cy.get("button[type=button]", { timeout: 10000 }).contains("New form").should("exist") - cy.get("button[type=button]").contains("New form").click() + cy.get("button[type=button]") + .contains("New form") + .should("be.visible") + .then($el => $el.click()) // Test updated title cy.get(".MuiListItem-container", { timeout: 10000 }).should("have.length", 1) diff --git a/cypress/integration/emptyForm.spec.js b/cypress/integration/emptyForm.spec.js index 3ac8b6ff6..888d7fe24 100644 --- a/cypress/integration/emptyForm.spec.js +++ b/cypress/integration/emptyForm.spec.js @@ -50,7 +50,10 @@ describe("empty form should not be alerted or saved", function () { cy.get("textarea[data-testid='description']").should("have.value", "Test experiment description") // Click Clear form button and expect the form is empty - cy.get("button[type='button']").contains("Clear form").click({ force: true }) + cy.get("button[type='button']") + .contains("Clear form") + .should("be.visible") + .then($el => $el.click()) cy.get("input[data-testid='title']").should("have.value", "") cy.get("textarea[data-testid='description']").should("have.value", "") diff --git a/cypress/integration/i18n.spec.js b/cypress/integration/i18n.spec.js index 5e70abef2..fb6ed6da5 100644 --- a/cypress/integration/i18n.spec.js +++ b/cypress/integration/i18n.spec.js @@ -7,8 +7,7 @@ describe("Internationalization", function () { cy.get("#lang-selector").click() cy.get("li[role=menuitem]").contains("Fi").click() - cy.get('[alt="CSC Login"]').click() - cy.wait(1000) + cy.login() cy.get("[data-testid='logged-in-as'").contains("Kirjautuneena") }) diff --git a/cypress/integration/linkingAccessionIds.spec.js b/cypress/integration/linkingAccessionIds.spec.js index 74d0fac74..7aee28eda 100644 --- a/cypress/integration/linkingAccessionIds.spec.js +++ b/cypress/integration/linkingAccessionIds.spec.js @@ -3,8 +3,7 @@ describe("Linking Accession Ids", function () { it("should link correct accessionIds to the related objects", () => { cy.visit(baseUrl) - cy.get('[alt="CSC Login"]').click() - cy.wait(1000) + cy.login() cy.get("button", { timeout: 10000 }).contains("Create Submission").click() // Add folder name & description, navigate to submissions @@ -229,7 +228,7 @@ describe("Linking Accession Ids", function () { cy.get("input[name='contacts.0.telephoneNumber']").click() cy.get("input[name='contacts.0.mainContact']").check() // Submit DAC form - cy.get('[data-testid=title]').type("test description") + cy.get("[data-testid=title]").type("test description") cy.get("button[type=submit]").contains("Submit").click() cy.get(".MuiListItem-container", { timeout: 10000 }).should("have.length", 1) // Get DACAccessionId diff --git a/cypress/support/commands.js b/cypress/support/commands.js index f2d2e44eb..00a592cf3 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -47,7 +47,7 @@ Cypress.on("uncaught:exception", () => { Cypress.Commands.add("login", () => { cy.visit(baseUrl) - cy.get('[alt="CSC Login"]').click() + cy.get('a[data-testid="login-button"]').click() cy.wait(1000) }) diff --git a/src/components/NewDraftWizard/WizardComponents/WizardDraftSelections.js b/src/components/NewDraftWizard/WizardComponents/WizardDraftSelections.js index e94c8afd6..d5ae9a015 100644 --- a/src/components/NewDraftWizard/WizardComponents/WizardDraftSelections.js +++ b/src/components/NewDraftWizard/WizardComponents/WizardDraftSelections.js @@ -59,7 +59,7 @@ const useStyles = makeStyles(theme => ({ }, }, viewButton: { - color: theme.palette.button.edit, + color: theme.palette.primary.main, margin: theme.spacing(1.5, 0), float: "right", }, @@ -70,7 +70,7 @@ const useStyles = makeStyles(theme => ({ justifyContent: "space-between", position: "sticky", zIndex: 1, - backgroundColor: theme.palette.background.default, + backgroundColor: theme.palette.background.paper, bottom: 0, }, })) diff --git a/src/theme.js b/src/theme.js index 5ca156fef..c8266326b 100644 --- a/src/theme.js +++ b/src/theme.js @@ -21,6 +21,7 @@ const palette = { }, background: { default: "#e5eff1", + paper: "#fff", }, success: { main: "#51a808", diff --git a/src/views/Login.js b/src/views/Login.js index 077840d75..10c1e9ee4 100644 --- a/src/views/Login.js +++ b/src/views/Login.js @@ -66,7 +66,7 @@ const Login = (): React$Element => { SD Submit Tool for submitting metadata. - + Login