diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index bc7a03a6f12..f09b1185e4a 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -14,7 +14,7 @@ describe('Happy Path Transfer Tests', () => { it('It should verify the working function of every permutation of transfer checkboxes', () => { cy.visit('/'); // Replace with the appropriate URL or navigation - /* + cy.verifyHomePage(); // This calls the custom command from commands.ts cy.clickCreateNew() / @@ -80,14 +80,16 @@ describe('Happy Path Transfer Tests', () => { cy.contains('Confirm').click() // ToDo make sure that the protocol overview stage works. cy.contains('Edit protocol').click() - cy.chooseDeckSlot('C2') + cy.chooseDeckSlot('C2').click() + cy.contains('Add hardware/labware').click() //cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click() cy.contains('Labware').click() cy.contains('Well plates').click() - cy.contains('Armadillo 96 Well Plate 200 µL PCR Full Skirt').click() + cy.contains('Armadillo 96 Well Plate 200 µL PCR Full Skirt').click({force:true}) cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) - - cy.get('foreignObject[x="164"][y="107"]') + // To do make a liquid adding function + // I suspect we're almost there, just need + cy.chooseDeckSlot('C2') .find('.Box-sc-8ozbhb-0.kIDovv') .find('a[role="button"]') .contains('Edit slot') @@ -97,7 +99,20 @@ describe('Happy Path Transfer Tests', () => { cy.contains('button', 'Define a liquid').click() cy.get('input[name="name"]') // Select the input with name="name" .type('My liquid!') - cy.get('button[type="submit"]').contains('Save').click(); + + cy.get('div[aria-label="ModalShell_ModalArea"]') + .find('form') // Target the form that wraps the button + .invoke('submit', (e) => { + e.preventDefault(); // Prevent default behavior + }); + +// Then click the Save button +cy.get('div[aria-label="ModalShell_ModalArea"]') + .find('button[type="submit"]') + .contains('Save') + .click(); + + //cy.get('button[type="submit"]').contains('Save').click(); //cy.contains('button','Save').click() diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 82bcddd2d0f..f2afef43a40 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -106,7 +106,8 @@ Cypress.Commands.add('verifyCreateNewHeader', () => { // Home Page Cypress.Commands.add('verifyHomePage', () => { - cy.contains('button', 'Confirm').click() + // Todo re-add when Once 8.2.2 comes back in + //cy.contains('button', 'Confirm').click() cy.contains(content.welcome) cy.contains('button', locators.createProtocol).should('be.visible') cy.contains('label', locators.editProtocol).should('be.visible') @@ -118,8 +119,9 @@ Cypress.Commands.add('verifyHomePage', () => { Cypress.Commands.add('clickCreateNew', () => { // cy.get('[data-testid="SettingsIconButton"]').click(); cy.getByTestId(locators.settingsDataTestid).click() - cy.get('[data-testid="analyticsToggle"] svg') - .should('have.css', 'fill', 'rgb(0, 108, 250)') + // ToDo re-add when 8.2.2 pushed to edge + // cy.get('[data-testid="analyticsToggle"] svg') + // .should('have.css', 'fill', 'rgb(0, 108, 250)') cy.getByTestId(locators.settingsDataTestid).click() cy.contains(locators.createProtocol).click() @@ -212,18 +214,18 @@ Cypress.Commands.add( Cypress.Commands.add('chooseDeckSlot', (slot: string) => { const deck_slots = { - A1: () => cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click(), - A2: () => cy.contains('foreignObject[x="164"][y="321"]', 'Edit slot').click(), - A3: () => cy.contains('foreignObject[x="328"][y="321"]', 'Edit slot').click(), - B1: () => cy.contains('foreignObject[x="0"][y="214"]', 'Edit slot').click(), - B2: () => cy.contains('foreignObject[x="164"][y="214"]', 'Edit slot').click(), - B3: () => cy.contains('foreignObject[x="328"][y="214"]', 'Edit slot').click(), - C1: () => cy.contains('foreignObject[x="0"][y="107"]', 'Edit slot').click(), - C2: () => cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click(), - C3: () => cy.contains('foreignObject[x="328"][y="107"]', 'Edit slot').click(), - D1: () => cy.contains('foreignObject[x="0"][y="0"]', 'Edit slot').click(), - D2: () => cy.contains('foreignObject[x="0"][y="0"]', 'Edit slot').click(), - D3: () => cy.contains('foreignObject[x="328"][y="0"]', 'Edit slot').click() + A1: () => cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot'), + A2: () => cy.contains('foreignObject[x="164"][y="321"]', 'Edit slot'), + A3: () => cy.contains('foreignObject[x="328"][y="321"]', 'Edit slot'), + B1: () => cy.contains('foreignObject[x="0"][y="214"]', 'Edit slot'), + B2: () => cy.contains('foreignObject[x="164"][y="214"]', 'Edit slot'), + B3: () => cy.contains('foreignObject[x="328"][y="214"]', 'Edit slot'), + C1: () => cy.contains('foreignObject[x="0"][y="107"]', 'Edit slot'), + C2: () => cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot'), + C3: () => cy.contains('foreignObject[x="328"][y="107"]', 'Edit slot'), + D1: () => cy.contains('foreignObject[x="0"][y="0"]', 'Edit slot'), + D2: () => cy.contains('foreignObject[x="0"][y="0"]', 'Edit slot'), + D3: () => cy.contains('foreignObject[x="328"][y="0"]', 'Edit slot') }; // Correct syntax: just assign the action to `slotAction` @@ -232,7 +234,7 @@ Cypress.Commands.add('chooseDeckSlot', (slot: string) => { // Call the corresponding Cypress command, if the action exists if (slotAction) { slotAction() // Execute the Cypress command for the selected slot - cy.contains('Add hardware/labware').click() + } else { throw new Error(`Slot ${slot} not found in deck slots.`); }