From d83c7292f31fbb99339ba9bec39fbe8885f09450 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Fri, 13 Dec 2024 18:09:25 -0500 Subject: [PATCH 01/31] I made a robotSelection() function added to commands.ts. Next commit will start to work on RQA-3792 to ensure all checkboxes are mantained for single-channel --- .../cypress/e2e/transferSettings.cy.js | 49 +++++++++++++++++++ protocol-designer/cypress/support/commands.ts | 21 ++++++++ 2 files changed, 70 insertions(+) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 6fded2dd9e6..0f67156e5e7 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,3 +1,45 @@ + + +import '../support/commands.ts'; // Importing the custom commands file + +const Flex_Home = 'Opentrons Flex'; +const OT2_Home = 'Opentrons OT-2'; + + +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() + cy.robotSelection(Flex_Home); + // ToDo Split pipette selector to only do one (left or right). + + + /* + const Flex_Home ='Opentrons Flex' + const OT2_Home = 'Opentrons OT-2' + cy.visit('/'); // Replace with the appropriate URL or navigation + cy.verifyHomePage(); // This calls the custom command from commands.ts + cy.clickCreateNew() + cy.contains('label', Flex_Home).should('be.visible') + cy.contains('label', OT2_Home ).should('be.visible').click() + cy.contains('button', "Confirm").should('be.visible') + + */ + + + + }); +}); + + + + + + + + // TODO: refactor to test with new navigation // const isMacOSX = Cypress.platform === 'darwin' // const batchEditClickOptions = { [isMacOSX ? 'metaKey' : 'ctrlKey']: true } @@ -43,7 +85,13 @@ // cy.get('button').contains('exit batch edit').should('exist') // } +/* describe('Advanced Settings for Transfer Form', () => { + cy.visit('/') + + + + // before(() => { // cy.visit('/') // cy.closeAnnouncementModal() @@ -345,3 +393,4 @@ describe('Advanced Settings for Transfer Form', () => { // }) // }) }) +*/ \ No newline at end of file diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 3f9ffd8ddd8..9477176e3ec 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -27,6 +27,7 @@ declare global { openDesignPage: () => Cypress.Chainable addStep: (stepName: string) => Cypress.Chainable openSettingsPage: () => Cypress.Chainable + robotSelection: (robotName: string) => Cypress.Chainable verifySettingsPage: () => Cypress.Chainable verifyCreateNewPage: () => Cypress.Chainable togglePreWetTip: () => Cypress.Chainable @@ -54,6 +55,8 @@ export const locators = { import: 'Import', createNew: 'Create new', createProtocol: 'Create a protocol', + Flex_Home: 'Opentrons Flex', + OT2_Home: "Opentrons OT-2", editProtocol: 'Edit existing protocol', settingsDataTestid: 'SettingsIconButton', settings: 'Settings', @@ -119,11 +122,29 @@ Cypress.Commands.add('importProtocol', (protocolFilePath: string) => { .selectFile(protocolFilePath, { force: true }) }) +Cypress.Commands.add('robotSelection',(robotName:string) =>{ + if (robotName ==='Opentrons OT-2') { + cy.contains('label', locators.OT2_Home ).should('be.visible').click() + + } + else { + // Just checking that the selection modal works + cy.contains('label', locators.OT2_Home ).should('be.visible').click() + cy.contains('label', locators.Flex_Home).should('be.visible').click() + + } + cy.contains('button', "Confirm").should('be.visible').click() + +}) + // Settings Page Actions Cypress.Commands.add('openSettingsPage', () => { cy.getByTestId(locators.settingsDataTestid).click() }) + + + Cypress.Commands.add('verifySettingsPage', () => { cy.verifyFullHeader() cy.contains(locators.settings).should('exist').should('be.visible') From 6b7eff3dd4f56aa4c8b466b4e67d7c0cef675c64 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 16 Dec 2024 15:04:18 -0500 Subject: [PATCH 02/31] you can now select pipettes --- .../cypress/e2e/transferSettings.cy.js | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 0f67156e5e7..3911b15b08a 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -12,10 +12,35 @@ describe('Happy Path Transfer Tests', () => { cy.visit('/'); // Replace with the appropriate URL or navigation cy.verifyHomePage(); // This calls the custom command from commands.ts cy.clickCreateNew() - cy.robotSelection(Flex_Home); - // ToDo Split pipette selector to only do one (left or right). - + cy.robotSelection(Flex_Home) + const pipette = '1-Channel' + function putPipette(pipette) { + cy.contains('label', pipette).should('exist').and('be.visible').click() + } + putPipette(pipette) + // Check step 2 has the right text + cy.contains('Step 2') + cy.contains('Add a pipette') + cy.contains('Pick your first pipette. If you need a second pipette, you can add it next.') + // Check + cy.contains('button', 'Go back').click() + cy.robotSelection(Flex_Home) + putPipette(pipette) + + + + + // ToDo split pipette selector to only do one (left or right). + // ToDo Get a function that grabs all pipette names to select on this page + /* + Select pipette + + Select tip + Select Modules + + + */ /* const Flex_Home ='Opentrons Flex' const OT2_Home = 'Opentrons OT-2' From df1942df921f4ea7943c2d686c8ca8dafc407b35 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 16 Dec 2024 18:10:19 -0500 Subject: [PATCH 03/31] I moved the base url to be the sandbox instead of local host. This way we can do testing. I also updated clickCreateNew to be compatible with 8.2.2 and beyond as well as check settings --- protocol-designer/cypress.config.js | 2 +- protocol-designer/cypress/e2e/transferSettings.cy.js | 2 ++ protocol-designer/cypress/support/commands.ts | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/protocol-designer/cypress.config.js b/protocol-designer/cypress.config.js index 98d139cdcbc..84d0adc4053 100644 --- a/protocol-designer/cypress.config.js +++ b/protocol-designer/cypress.config.js @@ -10,6 +10,6 @@ module.exports = defineConfig({ setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, - baseUrl: 'http://localhost:5178', + baseUrl: 'https://sandbox.designer.opentrons.com/chore_release-pd-8.2.2/#/', }, }) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 3911b15b08a..6800a2a048b 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -28,6 +28,8 @@ describe('Happy Path Transfer Tests', () => { putPipette(pipette) + + // ToDo split pipette selector to only do one (left or right). diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 9477176e3ec..3da085937db 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -111,7 +111,16 @@ Cypress.Commands.add('verifyHomePage', () => { }) Cypress.Commands.add('clickCreateNew', () => { + //8.2.2 adjustments + cy.contains('button', 'Confirm').click() + // 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)') + cy.getByTestId(locators.settingsDataTestid).click() cy.contains(locators.createProtocol).click() + + }) // Header Import @@ -198,6 +207,8 @@ Cypress.Commands.add( } ) + + Cypress.Commands.add('selectTipRacks', (left, right) => { if (left.length > 0) { cy.get("select[name*='left.tiprack']").select(left) From 5e9e55db35cefd75a43bedb3e173a30a329fb208 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 16 Dec 2024 18:18:23 -0500 Subject: [PATCH 04/31] updated url to 8.2.2 so we can plan for the confirmation modal --- protocol-designer/cypress.config.js | 2 +- protocol-designer/cypress/support/commands.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/protocol-designer/cypress.config.js b/protocol-designer/cypress.config.js index 84d0adc4053..1b3926639a4 100644 --- a/protocol-designer/cypress.config.js +++ b/protocol-designer/cypress.config.js @@ -10,6 +10,6 @@ module.exports = defineConfig({ setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, - baseUrl: 'https://sandbox.designer.opentrons.com/chore_release-pd-8.2.2/#/', + baseUrl: 'https://sandbox.designer.opentrons.com/chore_release-pd-8.2.2', }, }) diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 3da085937db..e982be5f61b 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -102,6 +102,7 @@ Cypress.Commands.add('verifyCreateNewHeader', () => { // Home Page Cypress.Commands.add('verifyHomePage', () => { + 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') From 29507263144d2e21db9ace0772fb8ce51e512120 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 16 Dec 2024 18:20:44 -0500 Subject: [PATCH 05/31] refactoring for 8.2.0 --- protocol-designer/cypress/e2e/import.cy.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol-designer/cypress/e2e/import.cy.ts b/protocol-designer/cypress/e2e/import.cy.ts index 83ddaf0577d..393a9b4f698 100644 --- a/protocol-designer/cypress/e2e/import.cy.ts +++ b/protocol-designer/cypress/e2e/import.cy.ts @@ -10,6 +10,7 @@ describe('The Import Page', () => { }) it('successfully loads a protocol exported on a previous version', () => { + cy.contains('button', 'Confirm').click() const protocol = getTestFile(TestFilePath.DoItAllV7) cy.importProtocol(protocol.path) verifyOldProtocolModal() @@ -17,6 +18,7 @@ describe('The Import Page', () => { }) it('successfully loads a protocol exported on the current version', () => { + cy.contains('button', 'Confirm').click() const protocol = getTestFile(TestFilePath.DoItAllV8) cy.importProtocol(protocol.path) verifyImportProtocolPage(protocol) From f1569548de156be789dc35d449ba3f0524b46fdd Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 16 Dec 2024 18:44:48 -0500 Subject: [PATCH 06/31] very small change to make JS checker happier --- protocol-designer/cypress/support/commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index e982be5f61b..e00b002878f 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -112,7 +112,7 @@ Cypress.Commands.add('verifyHomePage', () => { }) Cypress.Commands.add('clickCreateNew', () => { - //8.2.2 adjustments + // 8.2.2 adjustments cy.contains('button', 'Confirm').click() // cy.get('[data-testid="SettingsIconButton"]').click(); cy.getByTestId(locators.settingsDataTestid).click() From f40e60ec9544edd0640c29b5da9e63d1efcc9a24 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Tue, 17 Dec 2024 14:58:20 -0500 Subject: [PATCH 07/31] fixed the protocols using our little pop up. --- protocol-designer/cypress/support/commands.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index e00b002878f..c56942a2156 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -39,6 +39,7 @@ declare global { // Only Header, Home, and Settings page actions are here // due to their simplicity // Create and Import page actions are in their respective files +// Fixed clickCreateNew and above commands for 8.2.2 export const content = { siteTitle: 'Opentrons Protocol Designer', From 50c68369f61e596d095776dddd1647216077e097 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Tue, 17 Dec 2024 17:52:53 -0500 Subject: [PATCH 08/31] just added some functions to get us closer to transfer step 5 woo --- .../cypress/e2e/transferSettings.cy.js | 73 ++++++++++++++++++- protocol-designer/cypress/support/commands.ts | 2 - 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 6800a2a048b..9e69880ab16 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -2,9 +2,13 @@ import '../support/commands.ts'; // Importing the custom commands file + +/* +These constants will help us run through both test suites in one go +*/ const Flex_Home = 'Opentrons Flex'; const OT2_Home = 'Opentrons OT-2'; - +const pipette = '1-Channel' describe('Happy Path Transfer Tests', () => { it('It should verify the working function of every permutation of transfer checkboxes', () => { @@ -13,7 +17,7 @@ describe('Happy Path Transfer Tests', () => { cy.verifyHomePage(); // This calls the custom command from commands.ts cy.clickCreateNew() cy.robotSelection(Flex_Home) - const pipette = '1-Channel' + function putPipette(pipette) { cy.contains('label', pipette).should('exist').and('be.visible').click() } @@ -26,6 +30,71 @@ describe('Happy Path Transfer Tests', () => { cy.contains('button', 'Go back').click() cy.robotSelection(Flex_Home) putPipette(pipette) + // Make a function for this later that selects a pipette and its tips + let tip_volume = '50 µL' + let tip_rack = 'Filter Tip Rack 50 µL' + // I'm leaving them as "let" because they'll be lists some day + cy.contains(tip_volume).click() + cy.contains(tip_rack).click() + cy.contains('Confirm').click() + cy.contains('Left Mount').should('be.visible') + if (tip_rack === 'Filter Tip Rack 50 µL') { + cy.contains('Flex 1-Channel 50 μL').should('be.visible') + cy.contains(tip_rack).should('be.visible') + // block of code to be executed if the condition is true + } + cy.contains('Confirm').click() + // Gripper setup on step 3 of the onboarding flow + + let wantGripper = 'Yes' + function step3Gripper(wantGripper) { + cy.contains('Add a gripper').should('be.visible') + cy.contains('Do you want to move labware automatically with the gripper?').should('be.visible') + cy.contains('Yes').should('be.visible') + cy.contains('No').should('be.visible') + cy.contains('Yes').click() + cy.contains('button', 'Confirm').click() + return console.log('step 3 onboarding step looks good!') + } + step3Gripper(wantGripper) + // Maybe a module selection function? + function step4modules() { + + + cy.contains('Thermocycler Module GEN2').click() + cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') + cy.contains('Heater-Shaker Module GEN1').click() + cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') + cy.contains('Magnetic Block GEN1').click() + cy.get('img[alt="magneticBlockType"]').should('be.visible') + cy.contains('Temperature Module GEN2').click() + cy.get('img[alt="temperatureModuleType"]').should('be.visible') + cy.contains('Confirm').click() + } + step4modules() + // step 5 + + + /* + cy.get('img src="https://sandbox.designer.opentrons.com/chore_release-pd-8.2.2/assets/MagneticBlock_GEN1_HERO-BOB_hSjt.png"') + .should('be.visible') + cy.contains('Temperature Module GEN2').click() + */ + + + + + + + + + // + + + + + + diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index c56942a2156..6519b6aa8ae 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -113,8 +113,6 @@ Cypress.Commands.add('verifyHomePage', () => { }) Cypress.Commands.add('clickCreateNew', () => { - // 8.2.2 adjustments - cy.contains('button', 'Confirm').click() // cy.get('[data-testid="SettingsIconButton"]').click(); cy.getByTestId(locators.settingsDataTestid).click() cy.get('[data-testid="analyticsToggle"] svg') From 6300eaa60dc5726c72110ca1096e50c300897b9c Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Wed, 18 Dec 2024 11:23:34 -0500 Subject: [PATCH 09/31] move baseurl and made deck selector --- protocol-designer/cypress.config.js | 2 +- .../cypress/e2e/transferSettings.cy.js | 58 ++++++++++++++++++- protocol-designer/cypress/support/commands.ts | 33 ++++++++++- 3 files changed, 90 insertions(+), 3 deletions(-) diff --git a/protocol-designer/cypress.config.js b/protocol-designer/cypress.config.js index 1b3926639a4..789351581e0 100644 --- a/protocol-designer/cypress.config.js +++ b/protocol-designer/cypress.config.js @@ -10,6 +10,6 @@ module.exports = defineConfig({ setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, - baseUrl: 'https://sandbox.designer.opentrons.com/chore_release-pd-8.2.2', + baseUrl: 'https://sandbox.designer.opentrons.com/protocol-designer@8.2.2-candidate-b', }, }) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 9e69880ab16..d239b32523f 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -72,7 +72,63 @@ describe('Happy Path Transfer Tests', () => { cy.contains('Confirm').click() } step4modules() - // step 5 + // Todo Step 5 and Step 6 test + cy.contains('Confirm').click() + cy.contains('Confirm').click() + // ToDo make sure that the protocol overview stage works. + cy.contains('Edit protocol').click() + cy.chooseDeckSlot('C2') + //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.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) + cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click({force:true}) + + + + //cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click({force:true}) + + + + + + //cy.contains('Labware') + + //C2 + //cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click() + /* + List of foreign objects by their dimensions + 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() + + 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() +}; + + + */ /* diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 6519b6aa8ae..82bcddd2d0f 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -18,6 +18,9 @@ declare global { left_pipette_selector: string, right_pipette_selector: string ) => Cypress.Chainable + chooseDeckSlot: ( + slot: string + ) => Cypress.Chainable selectTipRacks: (left: string, right: string) => Cypress.Chainable addLiquid: ( liquidName: string, @@ -49,7 +52,7 @@ export const content = { welcome: 'Welcome to Protocol Designer!', appSettings: 'App Info', privacy: 'Privacy', - shareSessions: 'Share analytics with Opentrons', + shareSessions: 'Share analytics with Opentrons' } export const locators = { @@ -207,6 +210,34 @@ 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() + }; + + // Correct syntax: just assign the action to `slotAction` + const slotAction = deck_slots[slot]; + + // 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.`); + } +}); + Cypress.Commands.add('selectTipRacks', (left, right) => { From 2ccb2deeb3d46c0ebed02bb1c3277a62880eb036 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Wed, 18 Dec 2024 16:30:38 -0500 Subject: [PATCH 10/31] local host not updated yet --- protocol-designer/cypress.config.js | 2 +- .../cypress/e2e/transferSettings.cy.js | 27 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/protocol-designer/cypress.config.js b/protocol-designer/cypress.config.js index 789351581e0..98d139cdcbc 100644 --- a/protocol-designer/cypress.config.js +++ b/protocol-designer/cypress.config.js @@ -10,6 +10,6 @@ module.exports = defineConfig({ setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, - baseUrl: 'https://sandbox.designer.opentrons.com/protocol-designer@8.2.2-candidate-b', + baseUrl: 'http://localhost:5178', }, }) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index d239b32523f..bc7a03a6f12 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -14,9 +14,12 @@ 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() + / cy.robotSelection(Flex_Home) + function putPipette(pipette) { cy.contains('label', pipette).should('exist').and('be.visible').click() @@ -83,9 +86,31 @@ describe('Happy Path Transfer Tests', () => { cy.contains('Well plates').click() cy.contains('Armadillo 96 Well Plate 200 µL PCR Full Skirt').click() cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) - cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click({force:true}) + cy.get('foreignObject[x="164"][y="107"]') + .find('.Box-sc-8ozbhb-0.kIDovv') + .find('a[role="button"]') + .contains('Edit slot') + .click({force:true}) + cy.contains('button', 'Add liquid').click() + cy.contains('button', 'Liquid').click() + 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.contains('button','Save').click() + + + /* + + cy.get('foreignObject[x="164"][y="107"]') // Select the with specific attributes + .find('.Box-sc-8ozbhb-0.kIDovv') // Find the parent
inside it + .find('a[role="button"]') // Find the element acting as a button + .contains('Edit slot') // Ensure it contains the text "Edit slot" + .click() + */ //cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click({force:true}) From 13e762c34cf190d91ccd03ce510f2afca7599f5e Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 13:07:25 -0500 Subject: [PATCH 11/31] I changed chose deck slot to just return the deck slot. ToDo is to make an add lawbare and an add liquid function. --- .../cypress/e2e/transferSettings.cy.js | 27 +++++++++++---- protocol-designer/cypress/support/commands.ts | 34 ++++++++++--------- 2 files changed, 39 insertions(+), 22 deletions(-) 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.`); } From 391d04c83b8846ed31f1deb96bd1b04c1faa7b37 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 14:32:59 -0500 Subject: [PATCH 12/31] done --- .../cypress/e2e/transferSettings.cy.js | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index f09b1185e4a..82eac079c35 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -87,8 +87,9 @@ describe('Happy Path Transfer Tests', () => { cy.contains('Well plates').click() cy.contains('Armadillo 96 Well Plate 200 µL PCR Full Skirt').click({force:true}) cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) - // To do make a liquid adding function - // I suspect we're almost there, just need + // Todo make a liquid adding function + /* + */ cy.chooseDeckSlot('C2') .find('.Box-sc-8ozbhb-0.kIDovv') .find('a[role="button"]') @@ -110,7 +111,49 @@ describe('Happy Path Transfer Tests', () => { cy.get('div[aria-label="ModalShell_ModalArea"]') .find('button[type="submit"]') .contains('Save') - .click(); + .click() + + cy.get('circle[data-wellname="A1"]').click({ force: true }) + cy.get('circle[data-wellname="A2"]').click({ force: true }); + + +// Open the dropdown +cy.get('div[tabindex="0"].sc-bqWxrE').click(); + +// Select the option with specific text +cy.contains('My liquid!').click(); +cy.contains('Liquid') +cy.contains('Add liquid') +cy.contains('Liquid volume by well') +cy.contains('Cancel') +cy.get('input[name="volume"]').type(150) +cy.contains('button', 'Save').click(); +cy.contains('button', 'Done').click({force:true}) + +cy.chooseDeckSlot('C3').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('Bio-Rad 96 Well Plate 200 µL PCR').click({force:true}) +cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) +//cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) +// Todo make a liquid adding function +cy.contains('button','Protocol steps').click() +cy.contains('button', '+ Add Step').click() +cy.contains('button', 'Transfer').should('be.visible').click(); +cy.contains('Source labware') +cy.contains('Select source wells') +cy.contains('Destination labware') +cy.contains('Volume per well') +cy.contains('Tip handling') +cy.contains('Tip handling') +cy.contains('Tip drop location') + + + + + //cy.get('button[type="submit"]').contains('Save').click(); From 8750068e702d3295e783ae8786be05d12be3812c Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 15:01:08 -0500 Subject: [PATCH 13/31] we did it! It's prettier --- .../cypress/e2e/transferSettings.cy.js | 299 +++++++++--------- protocol-designer/cypress/support/commands.ts | 11 +- 2 files changed, 155 insertions(+), 155 deletions(-) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 82eac079c35..80ef8e55325 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,5 +1,3 @@ - - import '../support/commands.ts'; // Importing the custom commands file @@ -11,149 +9,160 @@ const OT2_Home = 'Opentrons OT-2'; const pipette = '1-Channel' 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() - / - cy.robotSelection(Flex_Home) - - - function putPipette(pipette) { - cy.contains('label', pipette).should('exist').and('be.visible').click() - } - putPipette(pipette) - // Check step 2 has the right text - cy.contains('Step 2') - cy.contains('Add a pipette') - cy.contains('Pick your first pipette. If you need a second pipette, you can add it next.') - // Check - cy.contains('button', 'Go back').click() - cy.robotSelection(Flex_Home) - putPipette(pipette) - // Make a function for this later that selects a pipette and its tips - let tip_volume = '50 µL' - let tip_rack = 'Filter Tip Rack 50 µL' - // I'm leaving them as "let" because they'll be lists some day - cy.contains(tip_volume).click() - cy.contains(tip_rack).click() - cy.contains('Confirm').click() - cy.contains('Left Mount').should('be.visible') - if (tip_rack === 'Filter Tip Rack 50 µL') { - cy.contains('Flex 1-Channel 50 μL').should('be.visible') - cy.contains(tip_rack).should('be.visible') - // block of code to be executed if the condition is true - } - cy.contains('Confirm').click() - // Gripper setup on step 3 of the onboarding flow - - let wantGripper = 'Yes' - function step3Gripper(wantGripper) { - cy.contains('Add a gripper').should('be.visible') - cy.contains('Do you want to move labware automatically with the gripper?').should('be.visible') - cy.contains('Yes').should('be.visible') - cy.contains('No').should('be.visible') - cy.contains('Yes').click() - cy.contains('button', 'Confirm').click() - return console.log('step 3 onboarding step looks good!') - } - step3Gripper(wantGripper) - // Maybe a module selection function? - function step4modules() { - - - cy.contains('Thermocycler Module GEN2').click() - cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') - cy.contains('Heater-Shaker Module GEN1').click() - cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') - cy.contains('Magnetic Block GEN1').click() - cy.get('img[alt="magneticBlockType"]').should('be.visible') - cy.contains('Temperature Module GEN2').click() - cy.get('img[alt="temperatureModuleType"]').should('be.visible') - cy.contains('Confirm').click() - } - step4modules() - // Todo Step 5 and Step 6 test - cy.contains('Confirm').click() - cy.contains('Confirm').click() - // ToDo make sure that the protocol overview stage works. - cy.contains('Edit protocol').click() - 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({force:true}) - cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) - // Todo make a liquid adding function - /* - */ - cy.chooseDeckSlot('C2') - .find('.Box-sc-8ozbhb-0.kIDovv') - .find('a[role="button"]') - .contains('Edit slot') - .click({force:true}) - cy.contains('button', 'Add liquid').click() - cy.contains('button', 'Liquid').click() - cy.contains('button', 'Define a liquid').click() - cy.get('input[name="name"]') // Select the input with name="name" - .type('My liquid!') - - 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('circle[data-wellname="A1"]').click({ force: true }) - cy.get('circle[data-wellname="A2"]').click({ force: true }); - - -// Open the dropdown -cy.get('div[tabindex="0"].sc-bqWxrE').click(); - -// Select the option with specific text -cy.contains('My liquid!').click(); -cy.contains('Liquid') -cy.contains('Add liquid') -cy.contains('Liquid volume by well') -cy.contains('Cancel') -cy.get('input[name="volume"]').type(150) -cy.contains('button', 'Save').click(); -cy.contains('button', 'Done').click({force:true}) - -cy.chooseDeckSlot('C3').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('Bio-Rad 96 Well Plate 200 µL PCR').click({force:true}) -cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) -//cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) -// Todo make a liquid adding function -cy.contains('button','Protocol steps').click() -cy.contains('button', '+ Add Step').click() -cy.contains('button', 'Transfer').should('be.visible').click(); -cy.contains('Source labware') -cy.contains('Select source wells') -cy.contains('Destination labware') -cy.contains('Volume per well') -cy.contains('Tip handling') -cy.contains('Tip handling') -cy.contains('Tip drop location') - - - - - + 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() / + cy.robotSelection(Flex_Home) + + + function putPipette(pipette) { + cy.contains('label', pipette).should('exist').and('be.visible').click() + } + putPipette(pipette) + // Check step 2 has the right text + cy.contains('Step 2') + cy.contains('Add a pipette') + cy.contains('Pick your first pipette. If you need a second pipette, you can add it next.') + // Check + cy.contains('button', 'Go back').click() + cy.robotSelection(Flex_Home) + putPipette(pipette) + // Make a function for this later that selects a pipette and its tips + let tip_volume = '50 µL' + let tip_rack = 'Filter Tip Rack 50 µL' + // I'm leaving them as "let" because they'll be lists some day + cy.contains(tip_volume).click() + cy.contains(tip_rack).click() + cy.contains('Confirm').click() + cy.contains('Left Mount').should('be.visible') + if (tip_rack === 'Filter Tip Rack 50 µL') { + cy.contains('Flex 1-Channel 50 μL').should('be.visible') + cy.contains(tip_rack).should('be.visible') + // block of code to be executed if the condition is true + } + cy.contains('Confirm').click() + // Gripper setup on step 3 of the onboarding flow + + let wantGripper = 'Yes' + + function step3Gripper(wantGripper) { + cy.contains('Add a gripper').should('be.visible') + cy.contains('Do you want to move labware automatically with the gripper?').should('be.visible') + cy.contains('Yes').should('be.visible') + cy.contains('No').should('be.visible') + cy.contains('Yes').click() + cy.contains('button', 'Confirm').click() + return console.log('step 3 onboarding step looks good!') + } + step3Gripper(wantGripper) + // Maybe a module selection function? + function step4modules() { + + + cy.contains('Thermocycler Module GEN2').click() + cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') + cy.contains('Heater-Shaker Module GEN1').click() + cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') + cy.contains('Magnetic Block GEN1').click() + cy.get('img[alt="magneticBlockType"]').should('be.visible') + cy.contains('Temperature Module GEN2').click() + cy.get('img[alt="temperatureModuleType"]').should('be.visible') + cy.contains('Confirm').click() + } + step4modules() + // Todo Step 5 and Step 6 test + cy.contains('Confirm').click() + cy.contains('Confirm').click() + // ToDo make sure that the protocol overview stage works. + cy.contains('Edit protocol').click() + 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({ + force: true + }) + cy.get('[data-testid="Toolbox_confirmButton"]').click({ + force: true + }) + // Todo make a liquid adding function + /* + */ + cy.chooseDeckSlot('C2') + .find('.Box-sc-8ozbhb-0.kIDovv') + .find('a[role="button"]') + .contains('Edit slot') + .click({ + force: true + }) + cy.contains('button', 'Add liquid').click() + cy.contains('button', 'Liquid').click() + cy.contains('button', 'Define a liquid').click() + cy.get('input[name="name"]') // Select the input with name="name" + .type('My liquid!') + + 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('circle[data-wellname="A1"]').click({ + force: true + }) + cy.get('circle[data-wellname="A2"]').click({ + force: true + }); + + + // Open the dropdown + cy.get('div[tabindex="0"].sc-bqWxrE').click(); + + // Select the option with specific text + cy.contains('My liquid!').click(); + cy.contains('Liquid') + cy.contains('Add liquid') + cy.contains('Liquid volume by well') + cy.contains('Cancel') + cy.get('input[name="volume"]').type(150) + cy.contains('button', 'Save').click(); + cy.contains('button', 'Done').click({ + force: true + }) + + cy.chooseDeckSlot('C3').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('Bio-Rad 96 Well Plate 200 µL PCR').click({ + force: true + }) + cy.get('[data-testid="Toolbox_confirmButton"]').click({ + force: true + }) + //cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) + // Todo make a liquid adding function + cy.contains('button', 'Protocol steps').click() + cy.contains('button', '+ Add Step').click() + cy.contains('button', 'Transfer').should('be.visible').click(); + cy.contains('Source labware') + cy.contains('Select source wells') + cy.contains('Destination labware') + cy.contains('Volume per well') + cy.contains('Tip handling') + cy.contains('Tip handling') + cy.contains('Tip drop location') //cy.get('button[type="submit"]').contains('Save').click(); diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index ab8ebc30ac5..e61fcc8cde4 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -9,7 +9,6 @@ declare global { verifyFullHeader: () => Cypress.Chainable verifyCreateNewHeader: () => Cypress.Chainable clickCreateNew: () => Cypress.Chainable - closeAnalyticsModal: () => Cypress.Chainable closeAnnouncementModal: () => Cypress.Chainable verifyHomePage: () => Cypress.Chainable importProtocol: (protocolFile: string) => Cypress.Chainable @@ -69,7 +68,6 @@ export const locators = { eula: 'a[href="https://opentrons.com/eula"]', privacyToggle: 'Settings_hotKeys', analyticsToggleTestId: 'analyticsToggle', - confirm: 'Confirm', } // General Custom Commands @@ -109,7 +107,7 @@ Cypress.Commands.add('verifyCreateNewHeader', () => { // Home Page Cypress.Commands.add('verifyHomePage', () => { // Todo re-add when Once 8.2.2 comes back in - //cy.contains('button', 'Confirm').click() + 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') @@ -130,13 +128,6 @@ Cypress.Commands.add('clickCreateNew', () => { }) -Cypress.Commands.add('closeAnalyticsModal', () => { - cy.get('button') - .contains(locators.confirm) - .should('be.visible') - .click({ force: true }) -}) - // Header Import Cypress.Commands.add('importProtocol', (protocolFilePath: string) => { cy.contains(locators.import).click() From 8259eecdc2b24751de7da241d95963ea6fc9726e Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 15:56:56 -0500 Subject: [PATCH 14/31] refactored and linted all tests --- protocol-designer/cypress/e2e/createNew.cy.ts | 2 +- protocol-designer/cypress/e2e/import.cy.ts | 2 +- .../cypress/e2e/migrations.cy.ts | 4 +- protocol-designer/cypress/e2e/settings.cy.ts | 2 +- .../cypress/e2e/transferSettings.cy.js | 788 ++++-------------- protocol-designer/cypress/support/commands.ts | 9 +- 6 files changed, 167 insertions(+), 640 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNew.cy.ts b/protocol-designer/cypress/e2e/createNew.cy.ts index fb1c70470b3..dc9745ae2a2 100644 --- a/protocol-designer/cypress/e2e/createNew.cy.ts +++ b/protocol-designer/cypress/e2e/createNew.cy.ts @@ -9,10 +9,10 @@ import { UniversalActions } from '../support/universalActions' describe('The Redesigned Create Protocol Landing Page', () => { beforeEach(() => { cy.visit('/') + cy.contains('button', 'Confirm').click() }) it('content and step 1 flow works', () => { - cy.closeAnalyticsModal() cy.clickCreateNew() cy.verifyCreateNewHeader() verifyCreateProtocolPage() diff --git a/protocol-designer/cypress/e2e/import.cy.ts b/protocol-designer/cypress/e2e/import.cy.ts index 847a3abc1c6..062f6f54e28 100644 --- a/protocol-designer/cypress/e2e/import.cy.ts +++ b/protocol-designer/cypress/e2e/import.cy.ts @@ -7,7 +7,7 @@ import { describe('The Import Page', () => { beforeEach(() => { cy.visit('/') - cy.closeAnalyticsModal() + }) it('successfully loads a protocol exported on a previous version', () => { diff --git a/protocol-designer/cypress/e2e/migrations.cy.ts b/protocol-designer/cypress/e2e/migrations.cy.ts index eb93db7ed51..91f4049de81 100644 --- a/protocol-designer/cypress/e2e/migrations.cy.ts +++ b/protocol-designer/cypress/e2e/migrations.cy.ts @@ -6,7 +6,9 @@ import { TestFilePath } from '../support/testFiles' describe('Protocol fixtures migrate and match snapshots', () => { beforeEach(() => { cy.visit('/') - cy.closeAnalyticsModal() + // Get rid of the analytics + cy.contains('button', 'Confirm').click() + }) const testCases: MigrateTestCase[] = [ diff --git a/protocol-designer/cypress/e2e/settings.cy.ts b/protocol-designer/cypress/e2e/settings.cy.ts index a9802484d89..7695a928516 100644 --- a/protocol-designer/cypress/e2e/settings.cy.ts +++ b/protocol-designer/cypress/e2e/settings.cy.ts @@ -1,7 +1,7 @@ describe('The Settings Page', () => { before(() => { cy.visit('/') - cy.closeAnalyticsModal() + cy.contains('button', 'Confirm').click() }) it('content and toggle state', () => { diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 80ef8e55325..00983344d37 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,640 +1,166 @@ -import '../support/commands.ts'; // Importing the custom commands file - +import '../support/commands.ts' // Importing the custom commands file /* These constants will help us run through both test suites in one go */ -const Flex_Home = 'Opentrons Flex'; -const OT2_Home = 'Opentrons OT-2'; +const Flex_Home = 'Opentrons Flex' +// const OT2_Home = 'Opentrons OT-2'; const pipette = '1-Channel' 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() / - cy.robotSelection(Flex_Home) - - - function putPipette(pipette) { - cy.contains('label', pipette).should('exist').and('be.visible').click() - } - putPipette(pipette) - // Check step 2 has the right text - cy.contains('Step 2') - cy.contains('Add a pipette') - cy.contains('Pick your first pipette. If you need a second pipette, you can add it next.') - // Check - cy.contains('button', 'Go back').click() - cy.robotSelection(Flex_Home) - putPipette(pipette) - // Make a function for this later that selects a pipette and its tips - let tip_volume = '50 µL' - let tip_rack = 'Filter Tip Rack 50 µL' - // I'm leaving them as "let" because they'll be lists some day - cy.contains(tip_volume).click() - cy.contains(tip_rack).click() - cy.contains('Confirm').click() - cy.contains('Left Mount').should('be.visible') - if (tip_rack === 'Filter Tip Rack 50 µL') { - cy.contains('Flex 1-Channel 50 μL').should('be.visible') - cy.contains(tip_rack).should('be.visible') - // block of code to be executed if the condition is true - } - cy.contains('Confirm').click() - // Gripper setup on step 3 of the onboarding flow - - let wantGripper = 'Yes' - - function step3Gripper(wantGripper) { - cy.contains('Add a gripper').should('be.visible') - cy.contains('Do you want to move labware automatically with the gripper?').should('be.visible') - cy.contains('Yes').should('be.visible') - cy.contains('No').should('be.visible') - cy.contains('Yes').click() - cy.contains('button', 'Confirm').click() - return console.log('step 3 onboarding step looks good!') - } - step3Gripper(wantGripper) - // Maybe a module selection function? - function step4modules() { - - - cy.contains('Thermocycler Module GEN2').click() - cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') - cy.contains('Heater-Shaker Module GEN1').click() - cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') - cy.contains('Magnetic Block GEN1').click() - cy.get('img[alt="magneticBlockType"]').should('be.visible') - cy.contains('Temperature Module GEN2').click() - cy.get('img[alt="temperatureModuleType"]').should('be.visible') - cy.contains('Confirm').click() - } - step4modules() - // Todo Step 5 and Step 6 test - cy.contains('Confirm').click() - cy.contains('Confirm').click() - // ToDo make sure that the protocol overview stage works. - cy.contains('Edit protocol').click() - 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({ - force: true - }) - cy.get('[data-testid="Toolbox_confirmButton"]').click({ - force: true - }) - // Todo make a liquid adding function - /* - */ - cy.chooseDeckSlot('C2') - .find('.Box-sc-8ozbhb-0.kIDovv') - .find('a[role="button"]') - .contains('Edit slot') - .click({ - force: true - }) - cy.contains('button', 'Add liquid').click() - cy.contains('button', 'Liquid').click() - cy.contains('button', 'Define a liquid').click() - cy.get('input[name="name"]') // Select the input with name="name" - .type('My liquid!') - - 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('circle[data-wellname="A1"]').click({ - force: true - }) - cy.get('circle[data-wellname="A2"]').click({ - force: true - }); - - - // Open the dropdown - cy.get('div[tabindex="0"].sc-bqWxrE').click(); - - // Select the option with specific text - cy.contains('My liquid!').click(); - cy.contains('Liquid') - cy.contains('Add liquid') - cy.contains('Liquid volume by well') - cy.contains('Cancel') - cy.get('input[name="volume"]').type(150) - cy.contains('button', 'Save').click(); - cy.contains('button', 'Done').click({ - force: true - }) - - cy.chooseDeckSlot('C3').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('Bio-Rad 96 Well Plate 200 µL PCR').click({ - force: true - }) - cy.get('[data-testid="Toolbox_confirmButton"]').click({ - force: true - }) - //cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) - // Todo make a liquid adding function - cy.contains('button', 'Protocol steps').click() - cy.contains('button', '+ Add Step').click() - cy.contains('button', 'Transfer').should('be.visible').click(); - cy.contains('Source labware') - cy.contains('Select source wells') - cy.contains('Destination labware') - cy.contains('Volume per well') - cy.contains('Tip handling') - cy.contains('Tip handling') - cy.contains('Tip drop location') - - //cy.get('button[type="submit"]').contains('Save').click(); - - //cy.contains('button','Save').click() - - - /* - - cy.get('foreignObject[x="164"][y="107"]') // Select the with specific attributes - .find('.Box-sc-8ozbhb-0.kIDovv') // Find the parent
inside it - .find('a[role="button"]') // Find the element acting as a button - .contains('Edit slot') // Ensure it contains the text "Edit slot" - .click() - - */ - - //cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click({force:true}) - - - - - - //cy.contains('Labware') - - //C2 - //cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click() - /* - List of foreign objects by their dimensions - 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() - - 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() -}; - - - */ - - - /* - cy.get('img src="https://sandbox.designer.opentrons.com/chore_release-pd-8.2.2/assets/MagneticBlock_GEN1_HERO-BOB_hSjt.png"') - .should('be.visible') - cy.contains('Temperature Module GEN2').click() - */ - - - - - - - - - // - - + it('It should verify the working function of every permutation of transfer checkboxes', () => { + cy.visit('/') // Replace with the appropriate URL or navigation - - - - - - - - - - // ToDo split pipette selector to only do one (left or right). - // ToDo Get a function that grabs all pipette names to select on this page - /* - Select pipette - - Select tip - Select Modules - - - - */ - /* - const Flex_Home ='Opentrons Flex' - const OT2_Home = 'Opentrons OT-2' - cy.visit('/'); // Replace with the appropriate URL or navigation - cy.verifyHomePage(); // This calls the custom command from commands.ts + cy.verifyHomePage() // This calls the custom command from commands.ts cy.clickCreateNew() - cy.contains('label', Flex_Home).should('be.visible') - cy.contains('label', OT2_Home ).should('be.visible').click() - cy.contains('button', "Confirm").should('be.visible') - - */ - - - - }); -}); - - - - - - - - -// TODO: refactor to test with new navigation -// const isMacOSX = Cypress.platform === 'darwin' -// const batchEditClickOptions = { [isMacOSX ? 'metaKey' : 'ctrlKey']: true } - -// const invalidInput = 'abcdefghijklmnopqrstuvwxyz!@#$%^&*()<>?,-' - -// function importProtocol() { -// cy.fixture('../../fixtures/protocol/5/transferSettings.json').then( -// fileContent => { -// cy.get('input[type=file]').upload({ -// fileContent: JSON.stringify(fileContent), -// fileName: 'fixture.json', -// mimeType: 'application/json', -// encoding: 'utf8', -// }) -// cy.get('[data-test="ComputingSpinner"]').should('exist') -// cy.get('div') -// .contains( -// 'Your protocol will be automatically updated to the latest version.' -// ) -// .should('exist') -// cy.get('button').contains('ok', { matchCase: false }).click() -// // wait until computation is done before proceeding, with generous timeout -// cy.get('[data-test="ComputingSpinner"]', { timeout: 30000 }).should( -// 'not.exist' -// ) -// } -// ) -// } - -// function openDesignTab() { -// cy.get('button[id=NavTab_design]').click() -// cy.get('button').contains('ok').click() - -// // Verify the Design Page -// cy.get('#TitleBar_main > h1').contains('Multi select banner test protocol') -// cy.get('#TitleBar_main > h2').contains('STARTING DECK STATE') -// cy.get('button[id=StepCreationButton]').contains('+ Add Step') -// } - -// function enterBatchEdit() { -// cy.get('[data-test="StepItem_1"]').click(batchEditClickOptions) -// cy.get('button').contains('exit batch edit').should('exist') -// } - -/* -describe('Advanced Settings for Transfer Form', () => { - cy.visit('/') - - - - - // before(() => { - // cy.visit('/') - // cy.closeAnnouncementModal() - // importProtocol() - // openDesignTab() - // }) - // it('Verify functionality of the transfer form', () => { - // // Verify functionality of advanced settings with different pipette and labware - // enterBatchEdit() - // // Different Pipette disables aspirate and dispense Flowrate and Mix settings - // // step 6 has different pipette than step 1 - // cy.get('[data-test="StepItem_6"]').click(batchEditClickOptions) - // // Pre-wet tip is always enabled - // cy.get('input[name="preWetTip"]').should('be.enabled') - // // well-order is always enabled - // cy.get('[id=WellOrderField_button_aspirate]').should('be.visible') - // // Aspirate Flowrate and mix disabled - // cy.get('input[name="aspirate_flowRate"]').should('be.disabled') - // cy.get('input[name="aspirate_mix_checkbox"]').should('be.disabled') - // // TipPosition Aspirate and Dispense should be disabled - // cy.get('[id=TipPositionIcon_aspirate_mmFromBottom]').should( - // 'not.be.enabled' - // ) - // cy.get('[id=TipPositionIcon_dispense_mmFromBottom]').should( - // 'not.be.enabled' - // ) - // // Dispense Flowrate and mix disabled - // cy.get('input[name="dispense_flowRate"]').should('be.disabled') - // cy.get('input[name="dispense_mix_checkbox"]').should('be.disabled') - // // Delay , Touch tip is disabled - // cy.get('input[name="aspirate_delay_checkbox"]').should('be.disabled') - // cy.get('input[name="aspirate_touchTip_checkbox"]').should('be.disabled') - // // Save button is disabled - // cy.get('button').contains('save').should('not.be.enabled') - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Verify functionality of advanced settings with same pipette and labware - // // click on step 2 in batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // deselecting on step 6 in batch edit mode - // cy.get('[data-test="StepItem_6"]').click(batchEditClickOptions) - // // click on step 3 , as step 2 & 3 have same pipette and labware - // cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions) - // // Aspirate Flowrate and mix are enabled - // cy.get('input[name="aspirate_flowRate"]').should('be.enabled') - // cy.get('input[name="aspirate_mix_checkbox"]').should('be.enabled') - // // Dispense Flowrate and mix are enabled - // cy.get('input[name="dispense_flowRate"]').should('be.enabled') - // cy.get('input[name="dispense_mix_checkbox"]').should('be.enabled') - // // Verify invalid input in one of the fields - // cy.get('input[name="dispense_mix_checkbox"]').click({ force: true }) - // cy.get('input[name="dispense_mix_volume"]') - // .type(invalidInput) - // .should('be.empty') - // // TipPosition Aspirate and Dispense should be enabled - // cy.get('[id=TipPositionIcon_aspirate_mmFromBottom]').should( - // 'not.be.disabled' - // ) - // cy.get('[id=TipPositionIcon_dispense_mmFromBottom]').should( - // 'not.be.disabled' - // ) - // // Delay in aspirate and Dispense settings is enabled - // cy.get('input[name="aspirate_delay_checkbox"]').should('be.enabled') - // cy.get('input[name="dispense_delay_checkbox"]').should('be.enabled') - // // Touchtip in aspirate and Dispense settings is enabled - // cy.get('input[name="aspirate_touchTip_checkbox"]').should('be.enabled') - // cy.get('input[name="dispense_touchTip_checkbox"]').should('be.enabled') - // // Blowout in dispense settings is enabled - // cy.get('input[name="blowout_checkbox"]').should('be.enabled') - // cy.get('button').contains('discard changes').click() - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Verify flowrate indeterminate value - // // click on step 2 in batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // cy.get('input[name="aspirate_flowRate"]').click({ force: true }) - // cy.contains( - // 'The default P1000 Single-Channel GEN2 flow rate is optimal for handling aqueous liquids' - // ) - // cy.get('input[name="aspirate_flowRate_customFlowRate"]').type('100') - // cy.get('button').contains('Done').click() - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Click on step 4 as it has flowrate set to 100 from previous testcase - // cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions) - // // indeterminate state in flowrate is empty - // cy.get('input[name="aspirate_flowRate"]').should('have.value', '') - // // Verify functionality of flowrate in batch edit transfer - // // Batch editing the Flowrate value - // cy.get('input[name="aspirate_flowRate"]').click({ force: true }) - // cy.contains( - // 'The default P1000 Single-Channel GEN2 flow rate is optimal for handling aqueous liquids' - // ) - // cy.get('input[name="aspirate_flowRate_customFlowRate"]').type('100') - // cy.get('button').contains('Done').click() - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Click on step 2 to verify that flowrate is updated to 100 - // cy.get('[data-test="StepItem_2"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that flowrate value - // cy.get('input[name="aspirate_flowRate"]').should('have.value', 100) - // // Click on step 3 to verify that flowrate is updated to 100 - // cy.get('[data-test="StepItem_3"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that flowrate value - // cy.get('input[name="aspirate_flowRate"]').should('have.value', 100) - // // Verify prewet tip indeterminate value - // // Click on step 2, to enter batch edit and enable prewet tip - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // enable pre-wet tip - // cy.togglePreWetTip() - // cy.get('input[name="preWetTip"]').should('be.enabled') - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Click on step 1, as it does not have prewet-tip selected - indeteminate state - // cy.get('[data-test="StepItem_1"]').click(batchEditClickOptions) - // // Check tooltip here - // cy.contains('pre-wet tip').trigger('pointerover') - // cy.get('div[role="tooltip"]').should( - // 'contain', - // 'Not all selected steps are using this setting' - // ) - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Verify mix settings indeterminate value - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions) - // // Select mix settings - // cy.mixaspirate() - // cy.get('input[name="aspirate_mix_volume"]').type('10') - // cy.get('input[name="aspirate_mix_times"]').type('2') - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Click on step 3 to generate indertminate state for mix settings. - // cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions) - // // Verify the tooltip here - // cy.contains('mix').trigger('pointerover') - // cy.get('div[role="tooltip"]').should( - // 'contain', - // 'Not all selected steps are using this setting' - // ) - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Verify mix settings batch editing in transfer form - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // Click on step 3 to batch edit mix settings - // cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions) - // cy.get('input[name="aspirate_mix_checkbox"]').click({ force: true }) - // // Select mix settings - // cy.get('input[name="aspirate_mix_volume"]').type('10') - // cy.get('input[name="aspirate_mix_times"]').type('2') - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Click on step 2 to verify that mix has volume set to 10 with 2 repitititons - // cy.get('[data-test="StepItem_2"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that volume is set to 10 and repetitions to 2 - // cy.get('input[name="aspirate_mix_volume"]').should('have.value', 10) - // cy.get('input[name="aspirate_mix_times"]').should('have.value', 2) - // // Verify delay settings indeterminate value - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // Select delay settings - // cy.get('input[name="aspirate_delay_checkbox"]') - // .check({ force: true }) - // .should('be.checked') - // cy.get('input[name="aspirate_delay_seconds"]').type('2') - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Click on step 3 to generate indertminate state for delay settings. - // cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions) - // // Verify the tooltip here - // cy.contains('delay').trigger('pointerover') - // cy.get('div[role="tooltip"]').should( - // 'contain', - // 'Not all selected steps are using this setting' - // ) - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Verify delay settings batch editing in transfer form - // // Click on step 4, to enter batch edit mode - // cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions) - // // Click on step 5 to batch edit mix settings - // cy.get('[data-test="StepItem_5"]').click(batchEditClickOptions) - // // Select delay settings - // cy.get('input[name="aspirate_delay_checkbox"]').click({ force: true }) - // cy.get('input[name="aspirate_delay_seconds"]').clear().type('2') - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Click on step 4 to verify that delay has volume set to 2 - // cy.get('[data-test="StepItem_4"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that volume is set to 2 and repitions to 2 - // cy.get('input[name="aspirate_delay_seconds"]').should('have.value', 2) - // // Click on step 5 to verify that delay has volume set to 2 - // cy.get('[data-test="StepItem_5"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that volume is set to 2 and repitions to 2 - // cy.get('input[name="aspirate_delay_seconds"]').should('have.value', 2) - // // Verify touchTip settings indeterminate value - // cy.get('[data-test="StepItem_2"]').click() - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // Select touchTip settings - // cy.get('input[name="aspirate_touchTip_checkbox"]').click({ force: true }) - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Click on step 5 to generate indertminate state for touchTip settings. - // cy.get('[data-test="StepItem_5"]').click(batchEditClickOptions) - // // Verify the tooltip here - // cy.contains('touch tip').trigger('pointerover') - // cy.get('div[role="tooltip"]').should( - // 'contain', - // 'Not all selected steps are using this setting' - // ) - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // verify touchTip settings batch editing in transfer form - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // Click on step 3 to batch edit mix settings - // cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions) - // // Select touchTip settings - // cy.get('input[name="aspirate_touchTip_checkbox"]').click({ force: true }) - // // cy.get('[id=TipPositionModal_custom_input]').type(15) - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Click on step 2 to verify that touchTip has volume set to 2 - // cy.get('[data-test="StepItem_2"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that volume is set - // cy.get('[id=TipPositionField_aspirate_touchTip_mmFromBottom]').should( - // 'have.value', - // 13.78 - // ) - // // Click on step 3 to verify that touchTip has volume set - // cy.get('[data-test="StepItem_3"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that volume is set - // cy.get('[id=TipPositionField_aspirate_touchTip_mmFromBottom]').should( - // 'have.value', - // 13.78 - // ) - // // verify blowout settings indeterminate value - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // Select blowout settings - // cy.get('input[name="blowout_checkbox"]').click({ force: true }) - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Click on step 4 to generate indertminate state for blowout settings. - // cy.get('[data-test="StepItem_4"]').click(batchEditClickOptions) - // // Verify the tooltip here - // cy.contains('blowout').trigger('pointerover') - // cy.get('div[role="tooltip"]').should( - // 'contain', - // 'Not all selected steps are using this setting' - // ) - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Verify blowout settings batch editing in transfer form - // // Click on step 2, to enter batch edit mode - // cy.get('[data-test="StepItem_2"]').click(batchEditClickOptions) - // // Click on step 3 to batch edit mix settings - // cy.get('[data-test="StepItem_3"]').click(batchEditClickOptions) - // // Select blowout settings - // cy.get('input[name="blowout_checkbox"]').click({ force: true }) - // // Click save button to save the changes - // cy.get('button').contains('save').click() - // // Exit batch edit mode - // cy.get('button').contains('exit batch edit').click() - // // Click on step 2 to verify that blowout has trash selected - // cy.get('[data-test="StepItem_2"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that trash is selected - // cy.get('[id=BlowoutLocationField_dropdown]').should($input => { - // const value = $input.val() - // const expectedSubstring = 'trashBin' - // expect(value).to.include(expectedSubstring) - // }) - // // Click on step 3 to verify the batch editing - // cy.get('[data-test="StepItem_3"]').click() - // cy.get('button[id="AspDispSection_settings_button_aspirate"]').click() - // // Verify that trash is selected for the blowout option - // cy.get('[id=BlowoutLocationField_dropdown]').should($input => { - // const value = $input.val() - // const expectedSubstring = 'trashBin' - // expect(value).to.include(expectedSubstring) - // }) - // }) -}) -*/ \ No newline at end of file + cy.robotSelection(Flex_Home) + + function putPipette (pipette) { + cy.contains('label', pipette).should('exist').and('be.visible').click() + } + putPipette(pipette) + // Check step 2 has the right text + cy.contains('Step 2') + cy.contains('Add a pipette') + cy.contains( + 'Pick your first pipette. If you need a second pipette, you can add it next.' + ) + // Check + cy.contains('button', 'Go back').click() + cy.robotSelection(Flex_Home) + putPipette(pipette) + // Make a function for this later that selects a pipette and its tips + const tip_volume = '50 µL' + const tip_rack = 'Filter Tip Rack 50 µL' + // I'm leaving them as "let" because they'll be lists some day + cy.contains(tip_volume).click() + cy.contains(tip_rack).click() + cy.contains('Confirm').click() + cy.contains('Left Mount').should('be.visible') + if (tip_rack === 'Filter Tip Rack 50 µL') { + cy.contains('Flex 1-Channel 50 μL').should('be.visible') + cy.contains(tip_rack).should('be.visible') + // block of code to be executed if the condition is true + } + cy.contains('Confirm').click() + // Gripper setup on step 3 of the onboarding flow + + const wantGripper = 'Yes' + + function step3Gripper (wantGripper) { + cy.contains('Add a gripper').should('be.visible') + cy.contains( + 'Do you want to move labware automatically with the gripper?' + ).should('be.visible') + cy.contains('Yes').should('be.visible') + cy.contains('No').should('be.visible') + cy.contains('Yes').click() + cy.contains('button', 'Confirm').click() + return console.log('step 3 onboarding step looks good!') + } + step3Gripper(wantGripper) + // Maybe a module selection function? + function step4modules () { + cy.contains('Thermocycler Module GEN2').click() + cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') + cy.contains('Heater-Shaker Module GEN1').click() + cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') + cy.contains('Magnetic Block GEN1').click() + cy.get('img[alt="magneticBlockType"]').should('be.visible') + cy.contains('Temperature Module GEN2').click() + cy.get('img[alt="temperatureModuleType"]').should('be.visible') + cy.contains('Confirm').click() + } + step4modules() + // Todo Step 5 and Step 6 test + cy.contains('Confirm').click() + cy.contains('Confirm').click() + // ToDo make sure that the protocol overview stage works. + cy.contains('Edit protocol').click() + 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({ + force: true, + }) + cy.get('[data-testid="Toolbox_confirmButton"]').click({ + force: true, + }) + // Todo make a liquid adding function + /* + */ + cy.chooseDeckSlot('C2') + .find('.Box-sc-8ozbhb-0.kIDovv') + .find('a[role="button"]') + .contains('Edit slot') + .click({ + force: true, + }) + cy.contains('button', 'Add liquid').click() + cy.contains('button', 'Liquid').click() + cy.contains('button', 'Define a liquid').click() + cy.get('input[name="name"]') // Select the input with name="name" + .type('My liquid!') + + 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('circle[data-wellname="A1"]').click({ + force: true, + }) + cy.get('circle[data-wellname="A2"]').click({ + force: true, + }) + + // Open the dropdown + cy.get('div[tabindex="0"].sc-bqWxrE').click() + + // Select the option with specific text + cy.contains('My liquid!').click() + cy.contains('Liquid') + cy.contains('Add liquid') + cy.contains('Liquid volume by well') + cy.contains('Cancel') + cy.get('input[name="volume"]').type(150) + cy.contains('button', 'Save').click() + cy.contains('button', 'Done').click({ + force: true, + }) + + cy.chooseDeckSlot('C3').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('Bio-Rad 96 Well Plate 200 µL PCR').click({ + force: true, + }) + cy.get('[data-testid="Toolbox_confirmButton"]').click({ + force: true, + }) + // cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) + // Todo make a liquid adding function + cy.contains('button', 'Protocol steps').click() + cy.contains('button', '+ Add Step').click() + cy.contains('button', 'Transfer').should('be.visible').click() + cy.contains('Source labware') + cy.contains('Select source wells') + cy.contains('Destination labware') + cy.contains('Volume per well') + cy.contains('Tip handling') + cy.contains('Tip handling') + cy.contains('Tip drop location') + + }) +}) \ No newline at end of file diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index e61fcc8cde4..961254d3483 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -213,7 +213,7 @@ Cypress.Commands.add( ) Cypress.Commands.add('chooseDeckSlot', (slot: string) => { - const deck_slots = { + const deckSlots = { 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'), @@ -229,10 +229,11 @@ Cypress.Commands.add('chooseDeckSlot', (slot: string) => { }; // Correct syntax: just assign the action to `slotAction` - const slotAction = deck_slots[slot]; + const slotAction = deckSlots[slot]; + // Call the corresponding Cypress command, if the action exists - if (slotAction) { + if (Boolean(slotAction)) { slotAction() // Execute the Cypress command for the selected slot } else { @@ -240,8 +241,6 @@ Cypress.Commands.add('chooseDeckSlot', (slot: string) => { } }); - - Cypress.Commands.add('selectTipRacks', (left, right) => { if (left.length > 0) { cy.get("select[name*='left.tiprack']").select(left) From 29903d3ae3ceacad7a9a4322dc181e970941caa8 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 17:54:04 -0500 Subject: [PATCH 15/31] formatting fixed in a few places with prettier --- protocol-designer/cypress/e2e/import.cy.ts | 1 - .../cypress/e2e/migrations.cy.ts | 3 +- .../cypress/e2e/transferSettings.cy.js | 9 ++- protocol-designer/cypress/support/commands.ts | 72 ++++++++++--------- 4 files changed, 42 insertions(+), 43 deletions(-) diff --git a/protocol-designer/cypress/e2e/import.cy.ts b/protocol-designer/cypress/e2e/import.cy.ts index 062f6f54e28..393a9b4f698 100644 --- a/protocol-designer/cypress/e2e/import.cy.ts +++ b/protocol-designer/cypress/e2e/import.cy.ts @@ -7,7 +7,6 @@ import { describe('The Import Page', () => { beforeEach(() => { cy.visit('/') - }) it('successfully loads a protocol exported on a previous version', () => { diff --git a/protocol-designer/cypress/e2e/migrations.cy.ts b/protocol-designer/cypress/e2e/migrations.cy.ts index 91f4049de81..4dc4c9be212 100644 --- a/protocol-designer/cypress/e2e/migrations.cy.ts +++ b/protocol-designer/cypress/e2e/migrations.cy.ts @@ -7,8 +7,7 @@ describe('Protocol fixtures migrate and match snapshots', () => { beforeEach(() => { cy.visit('/') // Get rid of the analytics - cy.contains('button', 'Confirm').click() - + cy.contains('button', 'Confirm').click() }) const testCases: MigrateTestCase[] = [ diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 00983344d37..ce93d170cfb 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -15,7 +15,7 @@ describe('Happy Path Transfer Tests', () => { cy.clickCreateNew() cy.robotSelection(Flex_Home) - function putPipette (pipette) { + function putPipette(pipette) { cy.contains('label', pipette).should('exist').and('be.visible').click() } putPipette(pipette) @@ -47,7 +47,7 @@ describe('Happy Path Transfer Tests', () => { const wantGripper = 'Yes' - function step3Gripper (wantGripper) { + function step3Gripper(wantGripper) { cy.contains('Add a gripper').should('be.visible') cy.contains( 'Do you want to move labware automatically with the gripper?' @@ -60,7 +60,7 @@ describe('Happy Path Transfer Tests', () => { } step3Gripper(wantGripper) // Maybe a module selection function? - function step4modules () { + function step4modules() { cy.contains('Thermocycler Module GEN2').click() cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') cy.contains('Heater-Shaker Module GEN1').click() @@ -161,6 +161,5 @@ describe('Happy Path Transfer Tests', () => { cy.contains('Tip handling') cy.contains('Tip handling') cy.contains('Tip drop location') - }) -}) \ No newline at end of file +}) diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 961254d3483..f2f35cbd1fd 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -18,9 +18,7 @@ declare global { left_pipette_selector: string, right_pipette_selector: string ) => Cypress.Chainable - chooseDeckSlot: ( - slot: string - ) => Cypress.Chainable + chooseDeckSlot: (slot: string) => Cypress.Chainable selectTipRacks: (left: string, right: string) => Cypress.Chainable addLiquid: ( liquidName: string, @@ -52,7 +50,7 @@ export const content = { welcome: 'Welcome to Protocol Designer!', appSettings: 'App Info', privacy: 'Privacy', - shareSessions: 'Share analytics with Opentrons' + shareSessions: 'Share analytics with Opentrons', } export const locators = { @@ -60,7 +58,7 @@ export const locators = { createNew: 'Create new', createProtocol: 'Create a protocol', Flex_Home: 'Opentrons Flex', - OT2_Home: "Opentrons OT-2", + OT2_Home: 'Opentrons OT-2', editProtocol: 'Edit existing protocol', settingsDataTestid: 'SettingsIconButton', settings: 'Settings', @@ -106,7 +104,7 @@ Cypress.Commands.add('verifyCreateNewHeader', () => { // Home Page Cypress.Commands.add('verifyHomePage', () => { - // Todo re-add when Once 8.2.2 comes back in + // 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') @@ -124,8 +122,6 @@ Cypress.Commands.add('clickCreateNew', () => { // .should('have.css', 'fill', 'rgb(0, 108, 250)') cy.getByTestId(locators.settingsDataTestid).click() cy.contains(locators.createProtocol).click() - - }) // Header Import @@ -136,19 +132,15 @@ Cypress.Commands.add('importProtocol', (protocolFilePath: string) => { .selectFile(protocolFilePath, { force: true }) }) -Cypress.Commands.add('robotSelection',(robotName:string) =>{ - if (robotName ==='Opentrons OT-2') { - cy.contains('label', locators.OT2_Home ).should('be.visible').click() - - } - else { - // Just checking that the selection modal works - cy.contains('label', locators.OT2_Home ).should('be.visible').click() - cy.contains('label', locators.Flex_Home).should('be.visible').click() - +Cypress.Commands.add('robotSelection', (robotName: string) => { + if (robotName === 'Opentrons OT-2') { + cy.contains('label', locators.OT2_Home).should('be.visible').click() + } else { + // Just checking that the selection modal works + cy.contains('label', locators.OT2_Home).should('be.visible').click() + cy.contains('label', locators.Flex_Home).should('be.visible').click() } - cy.contains('button', "Confirm").should('be.visible').click() - + cy.contains('button', 'Confirm').should('be.visible').click() }) // Settings Page Actions @@ -156,9 +148,6 @@ Cypress.Commands.add('openSettingsPage', () => { cy.getByTestId(locators.settingsDataTestid).click() }) - - - Cypress.Commands.add('verifySettingsPage', () => { cy.verifyFullHeader() cy.contains(locators.settings).should('exist').should('be.visible') @@ -213,7 +202,22 @@ Cypress.Commands.add( ) Cypress.Commands.add('chooseDeckSlot', (slot: string) => { - const deckSlots = { + // Define the deckSlots object with a Record type for valid keys + const deckSlots: Record< + | 'A1' + | 'A2' + | 'A3' + | 'B1' + | 'B2' + | 'B3' + | 'C1' + | 'C2' + | 'C3' + | 'D1' + | 'D2' + | 'D3', + () => void + > = { 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'), @@ -225,21 +229,19 @@ Cypress.Commands.add('chooseDeckSlot', (slot: string) => { 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` - const slotAction = deckSlots[slot]; + D3: () => cy.contains('foreignObject[x="328"][y="0"]', 'Edit slot'), + } + // Type-safe slot action assignment + const slotAction = deckSlots[slot as keyof typeof deckSlots] - // Call the corresponding Cypress command, if the action exists - if (Boolean(slotAction)) { - slotAction() // Execute the Cypress command for the selected slot - + // Check if slotAction exists and call it, else throw an error + if (slotAction) { + slotAction() // Execute the Cypress command for the selected slot } else { - throw new Error(`Slot ${slot} not found in deck slots.`); + throw new Error(`Slot ${slot} not found in deck slots.`) } -}); +}) Cypress.Commands.add('selectTipRacks', (left, right) => { if (left.length > 0) { From f402fa5161f6a867c1e3b1bd013407d5e683ce4f Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 18:09:07 -0500 Subject: [PATCH 16/31] hope this updates --- protocol-designer/cypress/e2e/transferSettings.cy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index ce93d170cfb..db5d4ed0eaa 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -15,7 +15,7 @@ describe('Happy Path Transfer Tests', () => { cy.clickCreateNew() cy.robotSelection(Flex_Home) - function putPipette(pipette) { + function putPipette (pipette) { cy.contains('label', pipette).should('exist').and('be.visible').click() } putPipette(pipette) @@ -47,7 +47,7 @@ describe('Happy Path Transfer Tests', () => { const wantGripper = 'Yes' - function step3Gripper(wantGripper) { + function step3Gripper (wantGripper) { cy.contains('Add a gripper').should('be.visible') cy.contains( 'Do you want to move labware automatically with the gripper?' @@ -60,7 +60,7 @@ describe('Happy Path Transfer Tests', () => { } step3Gripper(wantGripper) // Maybe a module selection function? - function step4modules() { + function step4modules () { cy.contains('Thermocycler Module GEN2').click() cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') cy.contains('Heater-Shaker Module GEN1').click() From 0a5c1c6eeec3c220a776944e562dac8ddddc71a9 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 18:21:44 -0500 Subject: [PATCH 17/31] another commit to finally fix the deck slot function --- protocol-designer/cypress/support/commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index f2f35cbd1fd..54ae8360664 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -216,7 +216,7 @@ Cypress.Commands.add('chooseDeckSlot', (slot: string) => { | 'D1' | 'D2' | 'D3', - () => void + () => Cypress.Chainable> > = { A1: () => cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot'), A2: () => cy.contains('foreignObject[x="164"][y="321"]', 'Edit slot'), From d7fb3d2ccecfb4647b4b144a93c446c751e46788 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Thu, 19 Dec 2024 18:35:39 -0500 Subject: [PATCH 18/31] small steps --- .../cypress/e2e/transferSettings.cy.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index db5d4ed0eaa..e1cae24f8ef 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -10,16 +10,20 @@ const pipette = '1-Channel' 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() cy.robotSelection(Flex_Home) - + /* function putPipette (pipette) { cy.contains('label', pipette).should('exist').and('be.visible').click() } - putPipette(pipette) + */ + + cy.contains('label', pipette).should('exist').and('be.visible').click() + + // lint error for now putPipette(pipette) // Check step 2 has the right text + cy.contains('Step 2') cy.contains('Add a pipette') cy.contains( @@ -28,7 +32,9 @@ describe('Happy Path Transfer Tests', () => { // Check cy.contains('button', 'Go back').click() cy.robotSelection(Flex_Home) - putPipette(pipette) + // putPipette(pipette) remove because lint error + cy.contains('label', pipette).should('exist').and('be.visible').click() + // Make a function for this later that selects a pipette and its tips const tip_volume = '50 µL' const tip_rack = 'Filter Tip Rack 50 µL' From 2d35674e4c5b0d8a4a602ea44e8f801149d4a9d5 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Fri, 20 Dec 2024 12:32:14 -0500 Subject: [PATCH 19/31] Did some prettier changes and am starting to move commands into createNew.ts --- protocol-designer/cypress/e2e/createNew.cy.ts | 3 +++ protocol-designer/cypress/e2e/transferSettings.cy.js | 6 +++--- protocol-designer/cypress/support/createNew.ts | 12 ++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNew.cy.ts b/protocol-designer/cypress/e2e/createNew.cy.ts index dc9745ae2a2..89e5969fbe7 100644 --- a/protocol-designer/cypress/e2e/createNew.cy.ts +++ b/protocol-designer/cypress/e2e/createNew.cy.ts @@ -37,7 +37,10 @@ describe('The Redesigned Create Protocol Landing Page', () => { Verifications.OnStep2, Verifications.NotNinetySixChannel, UniversalActions.Snapshot, + Actions.SingleChannelPipette, ] + // Everything after Actions.SingleChannelPipette + // Is going to be for transferSettings.cy.js runCreateTest(steps) }) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index e1cae24f8ef..35d8af922b3 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,5 +1,5 @@ import '../support/commands.ts' // Importing the custom commands file - +import '..support/createNew.ts' /* These constants will help us run through both test suites in one go */ @@ -53,7 +53,7 @@ describe('Happy Path Transfer Tests', () => { const wantGripper = 'Yes' - function step3Gripper (wantGripper) { + function step3Gripper(wantGripper) { cy.contains('Add a gripper').should('be.visible') cy.contains( 'Do you want to move labware automatically with the gripper?' @@ -66,7 +66,7 @@ describe('Happy Path Transfer Tests', () => { } step3Gripper(wantGripper) // Maybe a module selection function? - function step4modules () { + function step4modules() { cy.contains('Thermocycler Module GEN2').click() cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') cy.contains('Heater-Shaker Module GEN1').click() diff --git a/protocol-designer/cypress/support/createNew.ts b/protocol-designer/cypress/support/createNew.ts index b5fde778339..14374e73cf4 100644 --- a/protocol-designer/cypress/support/createNew.ts +++ b/protocol-designer/cypress/support/createNew.ts @@ -1,11 +1,13 @@ import { executeUniversalAction, UniversalActions } from './universalActions' import { isEnumValue } from './utils' +import '../support/commands.ts' export enum Actions { SelectFlex = 'Select Opentrons Flex', SelectOT2 = 'Select Opentrons OT-2', Confirm = 'Confirm', GoBack = 'Go back', + SingleChannelPipette = 'Select Pipette', } export enum Verifications { @@ -22,6 +24,8 @@ export enum Content { Step2Title = 'Step 2', AddPipette = 'Add a pipette', NinetySixChannel = '96-Channel', + SingleChannel = '1-Channel', + EightChannel = '8-Channel', GoBack = 'Go back', Confirm = 'Confirm', OpentronsFlex = 'Opentrons Flex', @@ -59,6 +63,14 @@ const executeAction = (action: Actions | UniversalActions): void => { case Actions.GoBack: cy.contains(Content.GoBack).should('be.visible').click() break + case Actions.SingleChannelPipette: + cy.contains('label', Content.SingleChannel) + .should('exist') + .and('be.visible') + .click() + + break + default: throw new Error(`Unrecognized action: ${action as string}`) } From 203d2bcd2b9d917efd32061022d08833ed14dc0c Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Fri, 20 Dec 2024 15:26:28 -0500 Subject: [PATCH 20/31] Made a new file createNewFlex.cy.ts this will be where I translate my transfer settings function --- .../cypress/e2e/createNewFlex.cy.ts | 39 +++++++++++++++++++ protocol-designer/cypress/e2e/import.cy.ts | 3 +- .../cypress/support/createNew.ts | 22 +++++++++-- 3 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 protocol-designer/cypress/e2e/createNewFlex.cy.ts diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts new file mode 100644 index 00000000000..195bb669b2e --- /dev/null +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -0,0 +1,39 @@ +import { + Actions, + Verifications, + runCreateTest, + verifyCreateProtocolPage, +} from '../support/createNew' +import { UniversalActions } from '../support/universalActions' + +describe('The Redesigned Create Protocol Landing Page', () => { + beforeEach(() => { + cy.visit('/') + cy.contains('button', 'Confirm').click() + }) + + it('content and step 1 flow works', () => { + cy.clickCreateNew() + cy.verifyCreateNewHeader() + verifyCreateProtocolPage() + const steps: Array = [ + Verifications.OnStep1, + Verifications.FlexSelected, + UniversalActions.Snapshot, + Actions.SelectOT2, + Verifications.OT2Selected, + UniversalActions.Snapshot, + Actions.SelectFlex, + Verifications.FlexSelected, + UniversalActions.Snapshot, + Actions.Confirm, + Verifications.OnStep2, + Actions.SingleChannelPipette50, + ] + + // Everything after Actions.SingleChannelPipette + // Is going to be for transferSettings.cy.js + + runCreateTest(steps) + }) +}) diff --git a/protocol-designer/cypress/e2e/import.cy.ts b/protocol-designer/cypress/e2e/import.cy.ts index 393a9b4f698..229533723eb 100644 --- a/protocol-designer/cypress/e2e/import.cy.ts +++ b/protocol-designer/cypress/e2e/import.cy.ts @@ -7,10 +7,10 @@ import { describe('The Import Page', () => { beforeEach(() => { cy.visit('/') + cy.contains('button', 'Confirm').click() }) it('successfully loads a protocol exported on a previous version', () => { - cy.contains('button', 'Confirm').click() const protocol = getTestFile(TestFilePath.DoItAllV7) cy.importProtocol(protocol.path) verifyOldProtocolModal() @@ -18,7 +18,6 @@ describe('The Import Page', () => { }) it('successfully loads a protocol exported on the current version', () => { - cy.contains('button', 'Confirm').click() const protocol = getTestFile(TestFilePath.DoItAllV8) cy.importProtocol(protocol.path) verifyImportProtocolPage(protocol) diff --git a/protocol-designer/cypress/support/createNew.ts b/protocol-designer/cypress/support/createNew.ts index 14374e73cf4..ebb6dd6a1eb 100644 --- a/protocol-designer/cypress/support/createNew.ts +++ b/protocol-designer/cypress/support/createNew.ts @@ -7,7 +7,7 @@ export enum Actions { SelectOT2 = 'Select Opentrons OT-2', Confirm = 'Confirm', GoBack = 'Go back', - SingleChannelPipette = 'Select Pipette', + SingleChannelPipette50 = 'Select Pipette', } export enum Verifications { @@ -17,6 +17,7 @@ export enum Verifications { OT2Selected = 'Opentrons OT-2 selected.', NinetySixChannel = '96-Channel option is available.', NotNinetySixChannel = '96-Channel option is not available.', + StepTwo50uL = 'StepTwo50uL', } export enum Content { @@ -26,12 +27,19 @@ export enum Content { NinetySixChannel = '96-Channel', SingleChannel = '1-Channel', EightChannel = '8-Channel', + TipRack = 'Filter Tip Rack 50 µL', + PipetteType = 'Pipette type', + PipetteVolume = 'Pipette volume', GoBack = 'Go back', Confirm = 'Confirm', OpentronsFlex = 'Opentrons Flex', OpentronsOT2 = 'Opentrons OT-2', LetsGetStarted = 'Let’s start with the basics', WhatKindOfRobot = 'What kind of robot do you have?', + Volume50 = '50 µL', + Volume1000 = '1000 µL', + FilterTiprack50 = 'Filter Tip Rack 50 µL', + Tiprack50 = 'Tip Rack 50 µL', } export enum Locators { @@ -63,12 +71,11 @@ const executeAction = (action: Actions | UniversalActions): void => { case Actions.GoBack: cy.contains(Content.GoBack).should('be.visible').click() break - case Actions.SingleChannelPipette: + case Actions.SingleChannelPipette50: cy.contains('label', Content.SingleChannel) .should('exist') .and('be.visible') .click() - break default: @@ -105,6 +112,15 @@ const verifyStep = (verification: Verifications): void => { case Verifications.NotNinetySixChannel: cy.contains(Content.NinetySixChannel).should('not.exist') break + case Verifications.StepTwo50uL: + // This function should get used after you select 50uL fully + cy.contains(Content.PipetteVolume) + cy.contains(Content.Volume50).should('be.visible') + cy.contains(Content.Volume1000).should('be.visible') + cy.contains(Content.FilterTiprack50).should('be.visible') + cy.contains(Content.FilterTiprack50).should('be.visible') + // cy.contains('Filter Tip Rack 50 µL').should('be.visible') + break default: throw new Error( `Unrecognized verification: ${verification as Verifications}` From fcd9fb72d607b2819f642177b20526e6e8a10e52 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Fri, 20 Dec 2024 18:17:43 -0500 Subject: [PATCH 21/31] Almost done with gripper. Moving onto modules --- protocol-designer/cypress/e2e/createNew.cy.ts | 3 - .../cypress/e2e/createNewFlex.cy.ts | 12 +++- .../cypress/e2e/transferSettings.cy.js | 4 +- .../cypress/support/createNew.ts | 60 +++++++++++++++++-- 4 files changed, 68 insertions(+), 11 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNew.cy.ts b/protocol-designer/cypress/e2e/createNew.cy.ts index 89e5969fbe7..dc9745ae2a2 100644 --- a/protocol-designer/cypress/e2e/createNew.cy.ts +++ b/protocol-designer/cypress/e2e/createNew.cy.ts @@ -37,10 +37,7 @@ describe('The Redesigned Create Protocol Landing Page', () => { Verifications.OnStep2, Verifications.NotNinetySixChannel, UniversalActions.Snapshot, - Actions.SingleChannelPipette, ] - // Everything after Actions.SingleChannelPipette - // Is going to be for transferSettings.cy.js runCreateTest(steps) }) diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index 195bb669b2e..3e7107a9b53 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -12,7 +12,7 @@ describe('The Redesigned Create Protocol Landing Page', () => { cy.contains('button', 'Confirm').click() }) - it('content and step 1 flow works', () => { + it('All steps for onboarding flow', () => { cy.clickCreateNew() cy.verifyCreateNewHeader() verifyCreateProtocolPage() @@ -29,6 +29,16 @@ describe('The Redesigned Create Protocol Landing Page', () => { Actions.Confirm, Verifications.OnStep2, Actions.SingleChannelPipette50, + Verifications.StepTwo50uL, + UniversalActions.Snapshot, + Actions.Confirm, + Verifications.StepTwoPart3, + UniversalActions.Snapshot, + Actions.Confirm, + Verifications.OnStep3, + Actions.YesGripper, + Actions.Confirm, + Verifications.Step4VerificationPart1, ] // Everything after Actions.SingleChannelPipette diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 35d8af922b3..2b94365ca33 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,5 +1,5 @@ -import '../support/commands.ts' // Importing the custom commands file -import '..support/createNew.ts' +import '../support/commands' // Importing the custom commands file + /* These constants will help us run through both test suites in one go */ diff --git a/protocol-designer/cypress/support/createNew.ts b/protocol-designer/cypress/support/createNew.ts index ebb6dd6a1eb..5490c46e8df 100644 --- a/protocol-designer/cypress/support/createNew.ts +++ b/protocol-designer/cypress/support/createNew.ts @@ -1,23 +1,26 @@ import { executeUniversalAction, UniversalActions } from './universalActions' import { isEnumValue } from './utils' -import '../support/commands.ts' - +import '../support/commands' export enum Actions { SelectFlex = 'Select Opentrons Flex', SelectOT2 = 'Select Opentrons OT-2', Confirm = 'Confirm', GoBack = 'Go back', - SingleChannelPipette50 = 'Select Pipette', + SingleChannelPipette50 = 'Select 50uL Single-Channel Pipette', + YesGripper = 'Select Yes to gripper', } export enum Verifications { OnStep1 = 'On Step 1 page.', OnStep2 = 'On Step 2 page.', + OnStep3 = 'On Step 3 page', FlexSelected = 'Opentrons Flex selected.', OT2Selected = 'Opentrons OT-2 selected.', NinetySixChannel = '96-Channel option is available.', NotNinetySixChannel = '96-Channel option is not available.', - StepTwo50uL = 'StepTwo50uL', + StepTwo50uL = 'Step Two part two', + StepTwoPart3 = 'Step Two part three', + Step4VerificationPart1 = 'Step 4 part 1', } export enum Content { @@ -30,6 +33,8 @@ export enum Content { TipRack = 'Filter Tip Rack 50 µL', PipetteType = 'Pipette type', PipetteVolume = 'Pipette volume', + FullP50SingleName = 'Flex 1-Channel 50 μL', + FullP50TiprackName = 'Opentrons Flex 96 Filter Tip Rack 50 µL', GoBack = 'Go back', Confirm = 'Confirm', OpentronsFlex = 'Opentrons Flex', @@ -40,6 +45,12 @@ export enum Content { Volume1000 = '1000 µL', FilterTiprack50 = 'Filter Tip Rack 50 µL', Tiprack50 = 'Tip Rack 50 µL', + Yes = 'Yes', + No = 'No', + Thermocycler = 'Thermocycler Module GEN2', + HeaterShaker = 'Heater-Shaker Module GEN1', + Tempdeck2 = 'Temperature Module GEN2', + MagBlock = 'Magnetic Block GEN1', } export enum Locators { @@ -76,6 +87,14 @@ const executeAction = (action: Actions | UniversalActions): void => { .should('exist') .and('be.visible') .click() + cy.contains(Content.Volume50).click() + cy.contains(Content.Tiprack50).click() + // ToDo after PR, why does this click Tiprack50 again + // instead of clicking the filter tiprack? + // cy.contains(Content.FilterTiprack50).click() + break + case Actions.YesGripper: + cy.contains(Content.Yes).click() break default: @@ -117,10 +136,41 @@ const verifyStep = (verification: Verifications): void => { cy.contains(Content.PipetteVolume) cy.contains(Content.Volume50).should('be.visible') cy.contains(Content.Volume1000).should('be.visible') + cy.contains(Content.Tiprack50).should('be.visible') cy.contains(Content.FilterTiprack50).should('be.visible') - cy.contains(Content.FilterTiprack50).should('be.visible') // cy.contains('Filter Tip Rack 50 µL').should('be.visible') break + case Verifications.StepTwoPart3: + // This function should get used after you select 50uL fully + cy.contains(Content.FullP50SingleName).should('be.visible') + cy.contains(Content.FullP50TiprackName).should('be.visible') + cy.contains('Left Mount').should('be.visible') + cy.contains(Content.Step2Title) + cy.contains('Robot pipettes') + cy.contains(Content.AddPipette) + // cy.contains('Filter Tip Rack 50 µL').should('be.visible') + break + case Verifications.OnStep3: + cy.contains('Add a gripper').should('be.visible') + cy.contains( + 'Do you want to move labware automatically with the gripper?' + ).should('be.visible') + cy.contains(Content.Yes).should('be.visible') + cy.contains(Content.No).should('be.visible') + break + case Verifications.Step4VerificationPart1: + cy.contains(Content.Thermocycler).should('be.visible') + + cy.contains(Content.HeaterShaker).should('be.visible') + + cy.contains(Content.MagBlock).should('be.visible') + cy.contains(Content.Tempdeck2).should('be.visible') + + cy.get('img[alt="temperatureModuleType"]').should('be.visible') + cy.get('img[alt="magneticBlockType"]').should('be.visible') + cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') + cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') + break default: throw new Error( `Unrecognized verification: ${verification as Verifications}` From 0b03395b63972d0cb031bc5a09c2faf6ce004054 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Fri, 20 Dec 2024 19:04:13 -0500 Subject: [PATCH 22/31] Check NewFlex.cy.ts I am almost there --- .../cypress/e2e/createNewFlex.cy.ts | 16 ++++- .../cypress/e2e/transferSettings.cy.js | 12 ---- .../cypress/support/createNew.ts | 67 ++++++++++++++++--- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index 3e7107a9b53..48fd17241a4 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -12,7 +12,7 @@ describe('The Redesigned Create Protocol Landing Page', () => { cy.contains('button', 'Confirm').click() }) - it('All steps for onboarding flow', () => { + it('content and step 1 flow works', () => { cy.clickCreateNew() cy.verifyCreateNewHeader() verifyCreateProtocolPage() @@ -38,7 +38,19 @@ describe('The Redesigned Create Protocol Landing Page', () => { Verifications.OnStep3, Actions.YesGripper, Actions.Confirm, - Verifications.Step4VerificationPart1, + Verifications.Step4Verification, + Actions.AddThermocycler, + Verifications.ThermocyclerImg, + Actions.AddHeaterShaker, + Verifications.HeaterShakerImg, + Actions.AddMagBlock, + Verifications.MagBlockImg, + Actions.AddTempdeck2, + Verifications.Tempdeck2Img, + Actions.Confirm, + Actions.Confirm, + Actions.Confirm, + Actions.EditProtocol, ] // Everything after Actions.SingleChannelPipette diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 2b94365ca33..6f943b32d5a 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,29 +1,19 @@ import '../support/commands' // Importing the custom commands file - /* These constants will help us run through both test suites in one go */ const Flex_Home = 'Opentrons Flex' // const OT2_Home = 'Opentrons OT-2'; const pipette = '1-Channel' - 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() cy.robotSelection(Flex_Home) - /* - function putPipette (pipette) { - cy.contains('label', pipette).should('exist').and('be.visible').click() - } - */ - cy.contains('label', pipette).should('exist').and('be.visible').click() - // lint error for now putPipette(pipette) // Check step 2 has the right text - cy.contains('Step 2') cy.contains('Add a pipette') cy.contains( @@ -34,7 +24,6 @@ describe('Happy Path Transfer Tests', () => { cy.robotSelection(Flex_Home) // putPipette(pipette) remove because lint error cy.contains('label', pipette).should('exist').and('be.visible').click() - // Make a function for this later that selects a pipette and its tips const tip_volume = '50 µL' const tip_rack = 'Filter Tip Rack 50 µL' @@ -143,7 +132,6 @@ describe('Happy Path Transfer Tests', () => { cy.contains('button', 'Done').click({ force: true, }) - cy.chooseDeckSlot('C3').click() cy.contains('Add hardware/labware').click() // cy.contains('foreignObject[x="164"][y="107"]', 'Edit slot').click() diff --git a/protocol-designer/cypress/support/createNew.ts b/protocol-designer/cypress/support/createNew.ts index 5490c46e8df..09aadc03fb4 100644 --- a/protocol-designer/cypress/support/createNew.ts +++ b/protocol-designer/cypress/support/createNew.ts @@ -1,6 +1,11 @@ import { executeUniversalAction, UniversalActions } from './universalActions' import { isEnumValue } from './utils' import '../support/commands' +// ToDo Future planning should have Step 5, Step 6, and 7 verification +// Todo ProtocolOverview page. This might change from deck map revamp, +// so let's hold off until then. +// This PR unblocks Sara and I to work on this separately, so I want +// To prioritize its getting pulled into the repo export enum Actions { SelectFlex = 'Select Opentrons Flex', SelectOT2 = 'Select Opentrons OT-2', @@ -8,24 +13,36 @@ export enum Actions { GoBack = 'Go back', SingleChannelPipette50 = 'Select 50uL Single-Channel Pipette', YesGripper = 'Select Yes to gripper', + NoGripper = 'Select no to gripper', + AddThermocycler = 'Thermocycler Module GEN2', + AddHeaterShaker = 'Heater-Shaker Module GEN1', + AddTempdeck2 = 'Temperature Module GEN2', + AddMagBlock = 'Magnetic Block GEN1', + EditProtocol = 'Blue button edit protocol', } export enum Verifications { OnStep1 = 'On Step 1 page.', OnStep2 = 'On Step 2 page.', - OnStep3 = 'On Step 3 page', + OnStep3 = 'on Step 3 page', FlexSelected = 'Opentrons Flex selected.', OT2Selected = 'Opentrons OT-2 selected.', NinetySixChannel = '96-Channel option is available.', NotNinetySixChannel = '96-Channel option is not available.', StepTwo50uL = 'Step Two part two', StepTwoPart3 = 'Step Two part three', - Step4VerificationPart1 = 'Step 4 part 1', + Step4Verification = 'Step 4 part 1', + ThermocyclerImg = 'Thermocycler Module GEN2', + HeaterShakerImg = 'Heater-Shaker Module GEN1', + Tempdeck2Img = 'Temperature Module GEN2', + MagBlockImg = 'Magnetic Block GEN1', } export enum Content { Step1Title = 'Step 1', Step2Title = 'Step 2', + Step3Title = 'Step3', + Step4Title = 'Step4', AddPipette = 'Add a pipette', NinetySixChannel = '96-Channel', SingleChannel = '1-Channel', @@ -51,6 +68,9 @@ export enum Content { HeaterShaker = 'Heater-Shaker Module GEN1', Tempdeck2 = 'Temperature Module GEN2', MagBlock = 'Magnetic Block GEN1', + ModulePageH = 'Add your modules', + ModulePageB = 'Select modules to use in your protocol.', + EditProtocol = 'Edit protocol', } export enum Locators { @@ -61,6 +81,10 @@ export enum Locators { FlexOption = 'button:contains("Opentrons Flex")', OT2Option = 'button:contains("Opentrons OT-2")', NinetySixChannel = 'div:contains("96-Channel")', + ThermocyclerImage = 'img[alt="temperatureModuleType"]', + MagblockImage = 'img[alt="magneticBlockType"]', + HeaterShakerImage = 'img[alt="heaterShakerModuleType"]', + TemperatureModuleImage = 'img[alt="temperatureModuleType"]', } const executeAction = (action: Actions | UniversalActions): void => { @@ -93,10 +117,27 @@ const executeAction = (action: Actions | UniversalActions): void => { // instead of clicking the filter tiprack? // cy.contains(Content.FilterTiprack50).click() break + case Actions.AddThermocycler: + cy.contains(Content.Thermocycler).click() + break + case Actions.AddHeaterShaker: + cy.contains(Content.HeaterShaker).click() + break + case Actions.AddTempdeck2: + cy.contains(Content.Tempdeck2).click() + break + case Actions.AddMagBlock: + cy.contains(Content.MagBlock).click() + break case Actions.YesGripper: cy.contains(Content.Yes).click() break - + case Actions.NoGripper: + cy.contains(Content.No).click() + break + case Actions.EditProtocol: + cy.contains(Content.EditProtocol).click() + break default: throw new Error(`Unrecognized action: ${action as string}`) } @@ -158,18 +199,22 @@ const verifyStep = (verification: Verifications): void => { cy.contains(Content.Yes).should('be.visible') cy.contains(Content.No).should('be.visible') break - case Verifications.Step4VerificationPart1: + case Verifications.Step4Verification: + cy.contains(Content.ModulePageH).should('be.visible') + cy.contains(Content.ModulePageB).should('be.visible') cy.contains(Content.Thermocycler).should('be.visible') - cy.contains(Content.HeaterShaker).should('be.visible') - cy.contains(Content.MagBlock).should('be.visible') cy.contains(Content.Tempdeck2).should('be.visible') - - cy.get('img[alt="temperatureModuleType"]').should('be.visible') - cy.get('img[alt="magneticBlockType"]').should('be.visible') - cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') - cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') + break + case Verifications.ThermocyclerImg: + cy.get(Locators.TemperatureModuleImage).should('be.visible') + break + case Verifications.HeaterShakerImg: + cy.get(Locators.HeaterShakerImage).should('be.visible') + break + case Verifications.Tempdeck2Img: + cy.contains(Content.Tempdeck2).should('be.visible') break default: throw new Error( From 2594d6368b3e4334c53939dc95ad90d4ca4f0d5a Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 23 Dec 2024 11:40:14 -0500 Subject: [PATCH 23/31] added closing analytics and selecting deck slots --- protocol-designer/cypress/e2e/createNew.cy.ts | 4 +- .../cypress/e2e/createNewFlex.cy.ts | 1 + protocol-designer/cypress/support/commands.ts | 9 +- .../cypress/support/createNew.ts | 96 +++++++++++++++++++ 4 files changed, 101 insertions(+), 9 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNew.cy.ts b/protocol-designer/cypress/e2e/createNew.cy.ts index dc9745ae2a2..0b085ae05eb 100644 --- a/protocol-designer/cypress/e2e/createNew.cy.ts +++ b/protocol-designer/cypress/e2e/createNew.cy.ts @@ -5,11 +5,11 @@ import { verifyCreateProtocolPage, } from '../support/createNew' import { UniversalActions } from '../support/universalActions' +import '../support/commands' describe('The Redesigned Create Protocol Landing Page', () => { beforeEach(() => { - cy.visit('/') - cy.contains('button', 'Confirm').click() + cy.closeAnnouncementModal() }) it('content and step 1 flow works', () => { diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index 48fd17241a4..1588effef7a 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -51,6 +51,7 @@ describe('The Redesigned Create Protocol Landing Page', () => { Actions.Confirm, Actions.Confirm, Actions.EditProtocol, + Actions.ChoseDeckSlotC2, ] // Everything after Actions.SingleChannelPipette diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 54ae8360664..8408c47cc22 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -170,13 +170,8 @@ Cypress.Commands.add('verifySettingsPage', () => { Cypress.Commands.add('closeAnnouncementModal', () => { // ComputingSpinner sometimes covers the announcement modal button and prevents the button click // this will retry until the ComputingSpinner does not exist - cy.get('[data-test="ComputingSpinner"]', { timeout: 30000 }).should( - 'not.exist' - ) - cy.get('button') - .contains('Got It!') - .should('be.visible') - .click({ force: true }) + cy.visit('/') + cy.contains('button', 'Confirm').click() }) // diff --git a/protocol-designer/cypress/support/createNew.ts b/protocol-designer/cypress/support/createNew.ts index 09aadc03fb4..37b3e8d8f93 100644 --- a/protocol-designer/cypress/support/createNew.ts +++ b/protocol-designer/cypress/support/createNew.ts @@ -19,6 +19,19 @@ export enum Actions { AddTempdeck2 = 'Temperature Module GEN2', AddMagBlock = 'Magnetic Block GEN1', EditProtocol = 'Blue button edit protocol', + choseDeckSlot = 'Chose each deck slot', + ChoseDeckSlotA1 = 'Choose deck slot A1', + ChoseDeckSlotA2 = 'Choose deck slot A2', + ChoseDeckSlotA3 = 'Choose deck slot A3', + ChoseDeckSlotB1 = 'Choose deck slot B1', + ChoseDeckSlotB2 = 'Choose deck slot B2', + ChoseDeckSlotB3 = 'Choose deck slot B3', + ChoseDeckSlotC1 = 'Choose deck slot C1', + ChoseDeckSlotC2 = 'Choose deck slot C2', + ChoseDeckSlotC3 = 'Choose deck slot C3', + ChoseDeckSlotD1 = 'Choose deck slot D1', + ChoseDeckSlotD2 = 'Choose deck slot D2', + ChoseDeckSlotD3 = 'Choose deck slot D3', } export enum Verifications { @@ -86,6 +99,52 @@ export enum Locators { HeaterShakerImage = 'img[alt="heaterShakerModuleType"]', TemperatureModuleImage = 'img[alt="temperatureModuleType"]', } +// Cypress Command Implementation +Cypress.Commands.add('chooseDeckSlot', (slot: string) => { + const deckSlots: Record< + | 'A1' + | 'A2' + | 'A3' + | 'B1' + | 'B2' + | 'B3' + | 'C1' + | 'C2' + | 'C3' + | 'D1' + | 'D2' + | 'D3', + () => Cypress.Chainable> + > = { + 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(), + } + + const slotAction = deckSlots[slot as keyof typeof deckSlots] + + if (slotAction) { + slotAction() + } else { + throw new Error(`Slot ${slot} not found in deck slots.`) + } +}) const executeAction = (action: Actions | UniversalActions): void => { if (isEnumValue([UniversalActions], [action])) { @@ -97,6 +156,7 @@ const executeAction = (action: Actions | UniversalActions): void => { case Actions.SelectFlex: cy.contains(Content.OpentronsFlex).should('be.visible').click() break + case Actions.SelectOT2: cy.contains(Content.OpentronsOT2).should('be.visible').click() break @@ -138,6 +198,42 @@ const executeAction = (action: Actions | UniversalActions): void => { case Actions.EditProtocol: cy.contains(Content.EditProtocol).click() break + case Actions.ChoseDeckSlotA1: + cy.chooseDeckSlot('A1') + break + case Actions.ChoseDeckSlotA2: + cy.chooseDeckSlot('A2') + break + case Actions.ChoseDeckSlotA3: + cy.chooseDeckSlot('A3') + break + case Actions.ChoseDeckSlotB1: + cy.chooseDeckSlot('B1') + break + case Actions.ChoseDeckSlotB2: + cy.chooseDeckSlot('B2') + break + case Actions.ChoseDeckSlotB3: + cy.chooseDeckSlot('B3') + break + case Actions.ChoseDeckSlotC1: + cy.chooseDeckSlot('C1') + break + case Actions.ChoseDeckSlotC2: + cy.chooseDeckSlot('C2') + break + case Actions.ChoseDeckSlotC3: + cy.chooseDeckSlot('C3') + break + case Actions.ChoseDeckSlotD1: + cy.chooseDeckSlot('D1') + break + case Actions.ChoseDeckSlotD2: + cy.chooseDeckSlot('D2') + break + case Actions.ChoseDeckSlotD3: + cy.chooseDeckSlot('D3') + break default: throw new Error(`Unrecognized action: ${action as string}`) } From 68acf18926135738af81371a6a9c70115e7bb162 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 23 Dec 2024 14:07:42 -0500 Subject: [PATCH 24/31] addressed the close analytics button --- protocol-designer/cypress/e2e/home.cy.ts | 1 + protocol-designer/cypress/e2e/migrations.cy.ts | 2 +- protocol-designer/cypress/e2e/settings.cy.ts | 2 +- protocol-designer/cypress/support/commands.ts | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol-designer/cypress/e2e/home.cy.ts b/protocol-designer/cypress/e2e/home.cy.ts index 211100898bf..ff2aecb3562 100644 --- a/protocol-designer/cypress/e2e/home.cy.ts +++ b/protocol-designer/cypress/e2e/home.cy.ts @@ -1,6 +1,7 @@ describe('The Home Page', () => { beforeEach(() => { cy.visit('/') + cy.closeAnnouncementModal() }) it('successfully loads', () => { diff --git a/protocol-designer/cypress/e2e/migrations.cy.ts b/protocol-designer/cypress/e2e/migrations.cy.ts index 4dc4c9be212..ed8db5562e5 100644 --- a/protocol-designer/cypress/e2e/migrations.cy.ts +++ b/protocol-designer/cypress/e2e/migrations.cy.ts @@ -7,7 +7,7 @@ describe('Protocol fixtures migrate and match snapshots', () => { beforeEach(() => { cy.visit('/') // Get rid of the analytics - cy.contains('button', 'Confirm').click() + cy.closeAnnouncementModal() }) const testCases: MigrateTestCase[] = [ diff --git a/protocol-designer/cypress/e2e/settings.cy.ts b/protocol-designer/cypress/e2e/settings.cy.ts index 7695a928516..14bf6d361ca 100644 --- a/protocol-designer/cypress/e2e/settings.cy.ts +++ b/protocol-designer/cypress/e2e/settings.cy.ts @@ -1,7 +1,7 @@ describe('The Settings Page', () => { before(() => { cy.visit('/') - cy.contains('button', 'Confirm').click() + cy.closeAnnouncementModal() }) it('content and toggle state', () => { diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 8408c47cc22..605207811f0 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -105,7 +105,6 @@ Cypress.Commands.add('verifyCreateNewHeader', () => { // Home Page Cypress.Commands.add('verifyHomePage', () => { // 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') From 1af99d62ed16c50b6ff3baa62c040278c46a5e4d Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 23 Dec 2024 14:18:42 -0500 Subject: [PATCH 25/31] addresses comments --- protocol-designer/cypress/e2e/createNewFlex.cy.ts | 2 +- protocol-designer/cypress/support/commands.ts | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index 1588effef7a..dd80641dd19 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -9,7 +9,7 @@ import { UniversalActions } from '../support/universalActions' describe('The Redesigned Create Protocol Landing Page', () => { beforeEach(() => { cy.visit('/') - cy.contains('button', 'Confirm').click() + cy.closeAnnouncementModal() }) it('content and step 1 flow works', () => { diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index 605207811f0..ba217708e90 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -9,7 +9,7 @@ declare global { verifyFullHeader: () => Cypress.Chainable verifyCreateNewHeader: () => Cypress.Chainable clickCreateNew: () => Cypress.Chainable - closeAnnouncementModal: () => Cypress.Chainable + closeAnalyticsModal: () => Cypress.Chainable verifyHomePage: () => Cypress.Chainable importProtocol: (protocolFile: string) => Cypress.Chainable verifyImportPageOldProtocol: () => Cypress.Chainable @@ -166,10 +166,9 @@ Cypress.Commands.add('verifySettingsPage', () => { // as a reference during test migration. /// ///////////////////////////////////////////////////////////////// -Cypress.Commands.add('closeAnnouncementModal', () => { +Cypress.Commands.add('closeAnalyticsModal', () => { // ComputingSpinner sometimes covers the announcement modal button and prevents the button click // this will retry until the ComputingSpinner does not exist - cy.visit('/') cy.contains('button', 'Confirm').click() }) From 6dea456a8568d40986733b0b979fbed1985a6e91 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 23 Dec 2024 14:22:48 -0500 Subject: [PATCH 26/31] close analytics modal to edit protocol --- protocol-designer/cypress/e2e/createNew.cy.ts | 2 +- protocol-designer/cypress/e2e/createNewFlex.cy.ts | 2 +- protocol-designer/cypress/e2e/home.cy.ts | 2 +- protocol-designer/cypress/e2e/import.cy.ts | 2 +- protocol-designer/cypress/e2e/migrations.cy.ts | 2 +- protocol-designer/cypress/e2e/settings.cy.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNew.cy.ts b/protocol-designer/cypress/e2e/createNew.cy.ts index 0b085ae05eb..288521f183a 100644 --- a/protocol-designer/cypress/e2e/createNew.cy.ts +++ b/protocol-designer/cypress/e2e/createNew.cy.ts @@ -9,7 +9,7 @@ import '../support/commands' describe('The Redesigned Create Protocol Landing Page', () => { beforeEach(() => { - cy.closeAnnouncementModal() + cy.closeAnalyticsModal() }) it('content and step 1 flow works', () => { diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index dd80641dd19..2e2df8e0852 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -9,7 +9,7 @@ import { UniversalActions } from '../support/universalActions' describe('The Redesigned Create Protocol Landing Page', () => { beforeEach(() => { cy.visit('/') - cy.closeAnnouncementModal() + cy.closeAnalyticsModal() }) it('content and step 1 flow works', () => { diff --git a/protocol-designer/cypress/e2e/home.cy.ts b/protocol-designer/cypress/e2e/home.cy.ts index ff2aecb3562..32a7c766d8e 100644 --- a/protocol-designer/cypress/e2e/home.cy.ts +++ b/protocol-designer/cypress/e2e/home.cy.ts @@ -1,7 +1,7 @@ describe('The Home Page', () => { beforeEach(() => { cy.visit('/') - cy.closeAnnouncementModal() + cy.closeAnalyticsModal() }) it('successfully loads', () => { diff --git a/protocol-designer/cypress/e2e/import.cy.ts b/protocol-designer/cypress/e2e/import.cy.ts index 229533723eb..8001f44f7d6 100644 --- a/protocol-designer/cypress/e2e/import.cy.ts +++ b/protocol-designer/cypress/e2e/import.cy.ts @@ -7,7 +7,7 @@ import { describe('The Import Page', () => { beforeEach(() => { cy.visit('/') - cy.contains('button', 'Confirm').click() + cy.closeAnalyticsModal() }) it('successfully loads a protocol exported on a previous version', () => { diff --git a/protocol-designer/cypress/e2e/migrations.cy.ts b/protocol-designer/cypress/e2e/migrations.cy.ts index ed8db5562e5..bd0c5d10f6c 100644 --- a/protocol-designer/cypress/e2e/migrations.cy.ts +++ b/protocol-designer/cypress/e2e/migrations.cy.ts @@ -7,7 +7,7 @@ describe('Protocol fixtures migrate and match snapshots', () => { beforeEach(() => { cy.visit('/') // Get rid of the analytics - cy.closeAnnouncementModal() + cy.closeAnalyticsModal() }) const testCases: MigrateTestCase[] = [ diff --git a/protocol-designer/cypress/e2e/settings.cy.ts b/protocol-designer/cypress/e2e/settings.cy.ts index 14bf6d361ca..a9802484d89 100644 --- a/protocol-designer/cypress/e2e/settings.cy.ts +++ b/protocol-designer/cypress/e2e/settings.cy.ts @@ -1,7 +1,7 @@ describe('The Settings Page', () => { before(() => { cy.visit('/') - cy.closeAnnouncementModal() + cy.closeAnalyticsModal() }) it('content and toggle state', () => { From 8739044dfaeed3700c067a279db1c2d26724dcf0 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Mon, 23 Dec 2024 17:11:33 -0500 Subject: [PATCH 27/31] I have remodeled the transferSetting.cy.js page and will build on it later --- .../cypress/e2e/createNewFlex.cy.ts | 22 +- .../cypress/e2e/transferSettings.cy.js | 229 ++++++------------ protocol-designer/cypress/support/commands.ts | 43 ---- .../cypress/support/createNew.ts | 216 ++++++++++++++--- 4 files changed, 277 insertions(+), 233 deletions(-) diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index 2e2df8e0852..05f88ac6af2 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -50,8 +50,28 @@ describe('The Redesigned Create Protocol Landing Page', () => { Actions.Confirm, Actions.Confirm, Actions.Confirm, - Actions.EditProtocol, + Actions.EditProtocolA, Actions.ChoseDeckSlotC2, + Actions.AddHardwareLabware, + Actions.ClickLabwareHeader, + Actions.ClickWellPlatesSection, + Actions.SelectArmadillo96WellPlate, + Actions.ChoseDeckSlotC2Labware, + Actions.AddLiquid, + Actions.ClickLiquidButton, + Actions.DefineLiquid, + Actions.LiquidSaveWIP, + Actions.WellSelector, + Actions.LiquidDropdown, + Verifications.LiquidPage, + UniversalActions.Snapshot, + Actions.SelectLiquidWells, + Actions.SetVolumeAndSaveforWells, + Actions.ChoseDeckSlotC3, + Actions.AddHardwareLabware, + Actions.ClickLabwareHeader, + Actions.ClickWellPlatesSection, + Actions.SelectBioRad96WellPlate, ] // Everything after Actions.SingleChannelPipette diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.js index 6f943b32d5a..05f88ac6af2 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.js @@ -1,159 +1,82 @@ -import '../support/commands' // Importing the custom commands file -/* -These constants will help us run through both test suites in one go -*/ -const Flex_Home = 'Opentrons Flex' -// const OT2_Home = 'Opentrons OT-2'; -const pipette = '1-Channel' -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() - cy.robotSelection(Flex_Home) - cy.contains('label', pipette).should('exist').and('be.visible').click() - // lint error for now putPipette(pipette) - // Check step 2 has the right text - cy.contains('Step 2') - cy.contains('Add a pipette') - cy.contains( - 'Pick your first pipette. If you need a second pipette, you can add it next.' - ) - // Check - cy.contains('button', 'Go back').click() - cy.robotSelection(Flex_Home) - // putPipette(pipette) remove because lint error - cy.contains('label', pipette).should('exist').and('be.visible').click() - // Make a function for this later that selects a pipette and its tips - const tip_volume = '50 µL' - const tip_rack = 'Filter Tip Rack 50 µL' - // I'm leaving them as "let" because they'll be lists some day - cy.contains(tip_volume).click() - cy.contains(tip_rack).click() - cy.contains('Confirm').click() - cy.contains('Left Mount').should('be.visible') - if (tip_rack === 'Filter Tip Rack 50 µL') { - cy.contains('Flex 1-Channel 50 μL').should('be.visible') - cy.contains(tip_rack).should('be.visible') - // block of code to be executed if the condition is true - } - cy.contains('Confirm').click() - // Gripper setup on step 3 of the onboarding flow - - const wantGripper = 'Yes' - - function step3Gripper(wantGripper) { - cy.contains('Add a gripper').should('be.visible') - cy.contains( - 'Do you want to move labware automatically with the gripper?' - ).should('be.visible') - cy.contains('Yes').should('be.visible') - cy.contains('No').should('be.visible') - cy.contains('Yes').click() - cy.contains('button', 'Confirm').click() - return console.log('step 3 onboarding step looks good!') - } - step3Gripper(wantGripper) - // Maybe a module selection function? - function step4modules() { - cy.contains('Thermocycler Module GEN2').click() - cy.get('img[alt="thermocyclerModuleType"]').should('be.visible') - cy.contains('Heater-Shaker Module GEN1').click() - cy.get('img[alt="heaterShakerModuleType"]').should('be.visible') - cy.contains('Magnetic Block GEN1').click() - cy.get('img[alt="magneticBlockType"]').should('be.visible') - cy.contains('Temperature Module GEN2').click() - cy.get('img[alt="temperatureModuleType"]').should('be.visible') - cy.contains('Confirm').click() - } - step4modules() - // Todo Step 5 and Step 6 test - cy.contains('Confirm').click() - cy.contains('Confirm').click() - // ToDo make sure that the protocol overview stage works. - cy.contains('Edit protocol').click() - 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({ - force: true, - }) - cy.get('[data-testid="Toolbox_confirmButton"]').click({ - force: true, - }) - // Todo make a liquid adding function - /* - */ - cy.chooseDeckSlot('C2') - .find('.Box-sc-8ozbhb-0.kIDovv') - .find('a[role="button"]') - .contains('Edit slot') - .click({ - force: true, - }) - cy.contains('button', 'Add liquid').click() - cy.contains('button', 'Liquid').click() - cy.contains('button', 'Define a liquid').click() - cy.get('input[name="name"]') // Select the input with name="name" - .type('My liquid!') +import { + Actions, + Verifications, + runCreateTest, + verifyCreateProtocolPage, +} from '../support/createNew' +import { UniversalActions } from '../support/universalActions' - 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() +describe('The Redesigned Create Protocol Landing Page', () => { + beforeEach(() => { + cy.visit('/') + cy.closeAnalyticsModal() + }) - cy.get('circle[data-wellname="A1"]').click({ - force: true, - }) - cy.get('circle[data-wellname="A2"]').click({ - force: true, - }) + it('content and step 1 flow works', () => { + cy.clickCreateNew() + cy.verifyCreateNewHeader() + verifyCreateProtocolPage() + const steps: Array = [ + Verifications.OnStep1, + Verifications.FlexSelected, + UniversalActions.Snapshot, + Actions.SelectOT2, + Verifications.OT2Selected, + UniversalActions.Snapshot, + Actions.SelectFlex, + Verifications.FlexSelected, + UniversalActions.Snapshot, + Actions.Confirm, + Verifications.OnStep2, + Actions.SingleChannelPipette50, + Verifications.StepTwo50uL, + UniversalActions.Snapshot, + Actions.Confirm, + Verifications.StepTwoPart3, + UniversalActions.Snapshot, + Actions.Confirm, + Verifications.OnStep3, + Actions.YesGripper, + Actions.Confirm, + Verifications.Step4Verification, + Actions.AddThermocycler, + Verifications.ThermocyclerImg, + Actions.AddHeaterShaker, + Verifications.HeaterShakerImg, + Actions.AddMagBlock, + Verifications.MagBlockImg, + Actions.AddTempdeck2, + Verifications.Tempdeck2Img, + Actions.Confirm, + Actions.Confirm, + Actions.Confirm, + Actions.EditProtocolA, + Actions.ChoseDeckSlotC2, + Actions.AddHardwareLabware, + Actions.ClickLabwareHeader, + Actions.ClickWellPlatesSection, + Actions.SelectArmadillo96WellPlate, + Actions.ChoseDeckSlotC2Labware, + Actions.AddLiquid, + Actions.ClickLiquidButton, + Actions.DefineLiquid, + Actions.LiquidSaveWIP, + Actions.WellSelector, + Actions.LiquidDropdown, + Verifications.LiquidPage, + UniversalActions.Snapshot, + Actions.SelectLiquidWells, + Actions.SetVolumeAndSaveforWells, + Actions.ChoseDeckSlotC3, + Actions.AddHardwareLabware, + Actions.ClickLabwareHeader, + Actions.ClickWellPlatesSection, + Actions.SelectBioRad96WellPlate, + ] - // Open the dropdown - cy.get('div[tabindex="0"].sc-bqWxrE').click() + // Everything after Actions.SingleChannelPipette + // Is going to be for transferSettings.cy.js - // Select the option with specific text - cy.contains('My liquid!').click() - cy.contains('Liquid') - cy.contains('Add liquid') - cy.contains('Liquid volume by well') - cy.contains('Cancel') - cy.get('input[name="volume"]').type(150) - cy.contains('button', 'Save').click() - cy.contains('button', 'Done').click({ - force: true, - }) - cy.chooseDeckSlot('C3').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('Bio-Rad 96 Well Plate 200 µL PCR').click({ - force: true, - }) - cy.get('[data-testid="Toolbox_confirmButton"]').click({ - force: true, - }) - // cy.get('[data-testid="Toolbox_confirmButton"]').click({ force: true }) - // Todo make a liquid adding function - cy.contains('button', 'Protocol steps').click() - cy.contains('button', '+ Add Step').click() - cy.contains('button', 'Transfer').should('be.visible').click() - cy.contains('Source labware') - cy.contains('Select source wells') - cy.contains('Destination labware') - cy.contains('Volume per well') - cy.contains('Tip handling') - cy.contains('Tip handling') - cy.contains('Tip drop location') + runCreateTest(steps) }) }) diff --git a/protocol-designer/cypress/support/commands.ts b/protocol-designer/cypress/support/commands.ts index ba217708e90..e23b2b0d6e0 100644 --- a/protocol-designer/cypress/support/commands.ts +++ b/protocol-designer/cypress/support/commands.ts @@ -18,7 +18,6 @@ declare global { left_pipette_selector: string, right_pipette_selector: string ) => Cypress.Chainable - chooseDeckSlot: (slot: string) => Cypress.Chainable selectTipRacks: (left: string, right: string) => Cypress.Chainable addLiquid: ( liquidName: string, @@ -194,48 +193,6 @@ Cypress.Commands.add( } ) -Cypress.Commands.add('chooseDeckSlot', (slot: string) => { - // Define the deckSlots object with a Record type for valid keys - const deckSlots: Record< - | 'A1' - | 'A2' - | 'A3' - | 'B1' - | 'B2' - | 'B3' - | 'C1' - | 'C2' - | 'C3' - | 'D1' - | 'D2' - | 'D3', - () => Cypress.Chainable> - > = { - 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'), - } - - // Type-safe slot action assignment - const slotAction = deckSlots[slot as keyof typeof deckSlots] - - // Check if slotAction exists and call it, else throw an error - if (slotAction) { - slotAction() // Execute the Cypress command for the selected slot - } else { - throw new Error(`Slot ${slot} not found in deck slots.`) - } -}) - Cypress.Commands.add('selectTipRacks', (left, right) => { if (left.length > 0) { cy.get("select[name*='left.tiprack']").select(left) diff --git a/protocol-designer/cypress/support/createNew.ts b/protocol-designer/cypress/support/createNew.ts index 37b3e8d8f93..e01b241d855 100644 --- a/protocol-designer/cypress/support/createNew.ts +++ b/protocol-designer/cypress/support/createNew.ts @@ -6,6 +6,7 @@ import '../support/commands' // so let's hold off until then. // This PR unblocks Sara and I to work on this separately, so I want // To prioritize its getting pulled into the repo +// Some day we should make a way to input variables into actions export enum Actions { SelectFlex = 'Select Opentrons Flex', SelectOT2 = 'Select Opentrons OT-2', @@ -18,7 +19,7 @@ export enum Actions { AddHeaterShaker = 'Heater-Shaker Module GEN1', AddTempdeck2 = 'Temperature Module GEN2', AddMagBlock = 'Magnetic Block GEN1', - EditProtocol = 'Blue button edit protocol', + EditProtocolA = 'Blue button edit protocol', choseDeckSlot = 'Chose each deck slot', ChoseDeckSlotA1 = 'Choose deck slot A1', ChoseDeckSlotA2 = 'Choose deck slot A2', @@ -28,10 +29,24 @@ export enum Actions { ChoseDeckSlotB3 = 'Choose deck slot B3', ChoseDeckSlotC1 = 'Choose deck slot C1', ChoseDeckSlotC2 = 'Choose deck slot C2', + ChoseDeckSlotC2Labware = 'Chose labware on deck slot C2', ChoseDeckSlotC3 = 'Choose deck slot C3', ChoseDeckSlotD1 = 'Choose deck slot D1', ChoseDeckSlotD2 = 'Choose deck slot D2', ChoseDeckSlotD3 = 'Choose deck slot D3', + AddHardwareLabware = 'Adds labware to deck slot by chose deck slot', + ClickLabwareHeader = 'Click Labware', + ClickWellPlatesSection = 'Click Well plates', + SelectArmadillo96WellPlate = 'Select Armadillo 96 Well Plate', + SelectBioRad96WellPlate = 'Select Bio-Rad 96 Well Plate', + AddLiquid = 'Add liquid', + DefineLiquid = 'Define a liquid', + ClickLiquidButton = 'Click Liquid button', + LiquidSaveWIP = 'Save liquid, is functional but could use a refactor', + WellSelector = 'Select wells with strings A1, A2, etc. comman separated LIST', + LiquidDropdown = 'Dropdown for liquids when adding to well', + SelectLiquidWells = 'Select Liquid Wells', + SetVolumeAndSaveforWells = 'Set volume and save for wells', } export enum Verifications { @@ -49,8 +64,9 @@ export enum Verifications { HeaterShakerImg = 'Heater-Shaker Module GEN1', Tempdeck2Img = 'Temperature Module GEN2', MagBlockImg = 'Magnetic Block GEN1', + LiquidPage = 'Liquid page content is visible', + TransferPopOut = 'Verify Step 1 of the transfer function is present', } - export enum Content { Step1Title = 'Step 1', Step2Title = 'Step 2', @@ -84,6 +100,16 @@ export enum Content { ModulePageH = 'Add your modules', ModulePageB = 'Select modules to use in your protocol.', EditProtocol = 'Edit protocol', + EditSlot = 'Edit slot', + AddLabwareToDeck = 'Add hardware/labware', + LabwareH = 'Labware', + WellPlatesCat = 'Well plates', + Armadillo96WellPlate200uL = 'Armadillo 96 Well Plate 200 µL PCR Full Skirt', + Biorad96WellPlate200uL = 'Bio-Rad 96 Well Plate 200 µL PCR', + AddLiquid = 'Add liquid', + DefineALiquid = 'Define a liquid', + LiquidButton = 'Liquid', + SampleLiquidName = 'My liquid!', } export enum Locators { @@ -98,8 +124,13 @@ export enum Locators { MagblockImage = 'img[alt="magneticBlockType"]', HeaterShakerImage = 'img[alt="heaterShakerModuleType"]', TemperatureModuleImage = 'img[alt="temperatureModuleType"]', + LiquidNameInput = 'input[name="name"]', + ModalShellArea = 'div[aria-label="ModalShell_ModalArea"]', + SaveButton = 'button[type="submit"]', + LiquidsDropdown = 'div[tabindex="0"].sc-bqWxrE', // Add new locator for the dropdown + LabwareSelectionLocation = '[data-testid="Toolbox_confirmButton"]', } -// Cypress Command Implementation +// Chose deck slot implementation Cypress.Commands.add('chooseDeckSlot', (slot: string) => { const deckSlots: Record< | 'A1' @@ -116,36 +147,63 @@ Cypress.Commands.add('chooseDeckSlot', (slot: string) => { | 'D3', () => Cypress.Chainable> > = { - 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="0"][y="321"]', Content.EditSlot), + A2: () => cy.contains('foreignObject[x="164"][y="321"]', Content.EditSlot), + A3: () => cy.contains('foreignObject[x="328"][y="321"]', Content.EditSlot), + B1: () => cy.contains('foreignObject[x="0"][y="214"]', Content.EditSlot), + B2: () => cy.contains('foreignObject[x="164"][y="214"]', Content.EditSlot), + B3: () => cy.contains('foreignObject[x="328"][y="214"]', Content.EditSlot), + C1: () => cy.contains('foreignObject[x="0"][y="107"]', Content.EditSlot), + C2: () => cy.contains('foreignObject[x="164"][y="107"]', Content.EditSlot), + C3: () => cy.contains('foreignObject[x="328"][y="107"]', Content.EditSlot), + D1: () => cy.contains('foreignObject[x="0"][y="0"]', Content.EditSlot), + D2: () => cy.contains('foreignObject[x="164"][y="0"]', Content.EditSlot), + D3: () => cy.contains('foreignObject[x="328"][y="0"]', Content.EditSlot), } const slotAction = deckSlots[slot as keyof typeof deckSlots] - if (slotAction) { + if (typeof slotAction === 'function') { slotAction() } else { throw new Error(`Slot ${slot} not found in deck slots.`) } }) +// Well name selection for liquids and in general +const selectWells = (wells: string[]): void => { + // Define a dictionary of well selectors + const wellSelectors: Record< + string, + () => Cypress.Chainable> + > = {} + + // Populate the dictionary dynamically + const rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] + const columns = Array.from({ length: 12 }, (_, i) => (i + 1).toString()) + + rows.forEach(row => { + columns.forEach(column => { + const wellName = `${row}${column}` + wellSelectors[wellName] = () => + cy.get(`circle[data-wellname="${wellName}"]`).click({ force: true }) + }) + }) + + // Iterate over the wells array and click the corresponding wells + wells.forEach(well => { + const wellAction = wellSelectors[well] + if (typeof wellAction === 'function') { + wellAction() // Click the well + } else { + throw new Error(`Well ${well} not found.`) + } + }) +} + +// Example usage +// selectWells(['A1', 'B3', 'H12']) + const executeAction = (action: Actions | UniversalActions): void => { if (isEnumValue([UniversalActions], [action])) { executeUniversalAction(action as UniversalActions) @@ -195,44 +253,111 @@ const executeAction = (action: Actions | UniversalActions): void => { case Actions.NoGripper: cy.contains(Content.No).click() break - case Actions.EditProtocol: + case Actions.EditProtocolA: cy.contains(Content.EditProtocol).click() break case Actions.ChoseDeckSlotA1: - cy.chooseDeckSlot('A1') + cy.chooseDeckSlot('A1').click() break case Actions.ChoseDeckSlotA2: - cy.chooseDeckSlot('A2') + cy.chooseDeckSlot('A2').click() break case Actions.ChoseDeckSlotA3: - cy.chooseDeckSlot('A3') + cy.chooseDeckSlot('A3').click() break case Actions.ChoseDeckSlotB1: - cy.chooseDeckSlot('B1') + cy.chooseDeckSlot('B1').click() break case Actions.ChoseDeckSlotB2: - cy.chooseDeckSlot('B2') + cy.chooseDeckSlot('B2').click() break case Actions.ChoseDeckSlotB3: - cy.chooseDeckSlot('B3') + cy.chooseDeckSlot('B3').click() break case Actions.ChoseDeckSlotC1: - cy.chooseDeckSlot('C1') + cy.chooseDeckSlot('C1').click() break case Actions.ChoseDeckSlotC2: - cy.chooseDeckSlot('C2') + cy.chooseDeckSlot('C2').click() break case Actions.ChoseDeckSlotC3: - cy.chooseDeckSlot('C3') + cy.chooseDeckSlot('C3').click() break case Actions.ChoseDeckSlotD1: - cy.chooseDeckSlot('D1') + cy.chooseDeckSlot('D1').click() break case Actions.ChoseDeckSlotD2: - cy.chooseDeckSlot('D2') + cy.chooseDeckSlot('D2').click() break case Actions.ChoseDeckSlotD3: - cy.chooseDeckSlot('D3') + cy.chooseDeckSlot('D3').click() + break + case Actions.AddHardwareLabware: // New case + cy.contains(Content.AddLabwareToDeck).click() + break + case Actions.ClickLabwareHeader: // New case + cy.contains(Content.LabwareH).click() + break + case Actions.ClickWellPlatesSection: // New case + cy.contains(Content.WellPlatesCat).click() + break + case Actions.ChoseDeckSlotC2Labware: + // Todo Investigate making a dictionary of slot editing. + // Maybe next PR + cy.chooseDeckSlot('C2') + .find('.Box-sc-8ozbhb-0.kIDovv') + .find('a[role="button"]') + .contains(Content.EditSlot) + .click({ force: true }) + break + case Actions.SelectArmadillo96WellPlate: // New case for selecting Armadillo plate + cy.contains(Content.Armadillo96WellPlate200uL).click({ force: true }) + cy.get(Locators.LabwareSelectionLocation).click({ force: true }) + break + case Actions.SelectBioRad96WellPlate: // New case for selecting Armadillo plate + cy.contains(Content.Biorad96WellPlate200uL).click({ force: true }) + cy.get(Locators.LabwareSelectionLocation).click({ force: true }) + break + + case Actions.AddLiquid: // New case for "Add liquid" + cy.contains('button', Content.AddLiquid).click() + break + case Actions.ClickLiquidButton: // New case for "Liquid button" + cy.contains('button', Content.LiquidButton).click() + break + case Actions.DefineLiquid: // New case for "Define a liquid" + cy.contains('button', Content.DefineALiquid).click() + break + case Actions.LiquidSaveWIP: + cy.get(Locators.LiquidNameInput) // Locate the input with name="name" + .type(Content.SampleLiquidName) + + cy.get(Locators.ModalShellArea) + .find('form') // Target the form inside the modal + .invoke('submit', e => { + e.preventDefault() // Prevent default form submission + }) + + cy.get(Locators.ModalShellArea) + .find(Locators.SaveButton) // Locate the Save button + .contains('Save') + .click() // Trigger the Save button + break + case Actions.WellSelector: + selectWells(['A1', 'A2']) + break + case Actions.LiquidDropdown: // New case for dropdown + cy.get(Locators.LiquidsDropdown) + .should('be.visible') // Ensure the dropdown is visible + .click() // Click the dropdown + break + case Actions.SelectLiquidWells: + cy.contains('My liquid!').click() // Action for clicking 'My liquid!' + break + case Actions.SetVolumeAndSaveforWells: + cy.get('input[name="volume"]').type(`150`) // Set volume + cy.contains('button', 'Save').click() // Click Save button + cy.contains('button', 'Done').click({ force: true }) // Click Done button, forcing click if necessary break default: throw new Error(`Unrecognized action: ${action as string}`) @@ -312,6 +437,25 @@ const verifyStep = (verification: Verifications): void => { case Verifications.Tempdeck2Img: cy.contains(Content.Tempdeck2).should('be.visible') break + case Verifications.LiquidPage: + cy.contains('Liquid').should('be.visible') + cy.contains('Add liquid').should('be.visible') + cy.contains('Liquid volume by well').should('be.visible') + cy.contains('Cancel').should('be.visible') + break + case Verifications.TransferPopOut: + cy.contains('button', 'Protocol steps').click() + cy.contains('button', '+ Add Step').click() + cy.contains('button', 'Transfer').should('be.visible').click() + cy.contains('Source labware') + cy.contains('Select source wells') + cy.contains('Destination labware') + cy.contains('Volume per well') + cy.contains('Tip handling') + cy.contains('Tip handling') + cy.contains('Tip drop location') + break + default: throw new Error( `Unrecognized verification: ${verification as Verifications}` From 1f4e8d65d9656d31d140c05b7217ca73c9d5ed88 Mon Sep 17 00:00:00 2001 From: alexjoel42 Date: Tue, 24 Dec 2024 12:00:46 -0500 Subject: [PATCH 28/31] I think this should work! No typescript errors --- .../cypress/e2e/createNewFlex.cy.ts | 4 --- ...rSettings.cy.js => transferSettings.cy.ts} | 23 +++++++++++++--- protocol-designer/cypress/support/commands.ts | 1 - .../cypress/support/createNew.ts | 26 ++++++++++++++++--- 4 files changed, 41 insertions(+), 13 deletions(-) rename protocol-designer/cypress/e2e/{transferSettings.cy.js => transferSettings.cy.ts} (71%) diff --git a/protocol-designer/cypress/e2e/createNewFlex.cy.ts b/protocol-designer/cypress/e2e/createNewFlex.cy.ts index 05f88ac6af2..8eca2f92dcc 100644 --- a/protocol-designer/cypress/e2e/createNewFlex.cy.ts +++ b/protocol-designer/cypress/e2e/createNewFlex.cy.ts @@ -73,10 +73,6 @@ describe('The Redesigned Create Protocol Landing Page', () => { Actions.ClickWellPlatesSection, Actions.SelectBioRad96WellPlate, ] - - // Everything after Actions.SingleChannelPipette - // Is going to be for transferSettings.cy.js - runCreateTest(steps) }) }) diff --git a/protocol-designer/cypress/e2e/transferSettings.cy.js b/protocol-designer/cypress/e2e/transferSettings.cy.ts similarity index 71% rename from protocol-designer/cypress/e2e/transferSettings.cy.js rename to protocol-designer/cypress/e2e/transferSettings.cy.ts index 05f88ac6af2..03383cb7334 100644 --- a/protocol-designer/cypress/e2e/transferSettings.cy.js +++ b/protocol-designer/cypress/e2e/transferSettings.cy.ts @@ -9,6 +9,7 @@ import { UniversalActions } from '../support/universalActions' describe('The Redesigned Create Protocol Landing Page', () => { beforeEach(() => { cy.visit('/') + cy.verifyHomePage() cy.closeAnalyticsModal() }) @@ -72,11 +73,25 @@ describe('The Redesigned Create Protocol Landing Page', () => { Actions.ClickLabwareHeader, Actions.ClickWellPlatesSection, Actions.SelectBioRad96WellPlate, + Actions.ProtocolStepsH, + Actions.AddStep, + Verifications.TransferPopOut, + UniversalActions.Snapshot, ] - - // Everything after Actions.SingleChannelPipette - // Is going to be for transferSettings.cy.js - runCreateTest(steps) + /* Future work + We need a better selector for source and destinatino wells.. they have the same selector + Source wells + cy.get(':nth-child(5) > .bsOFGI > .jmUzTo > .jBlELz > .sc-bqWxrE') + cy.get('div[tabindex="0"].sc-bqWxrE').contains('Choose wells').click() + Destination wells + cy.get(':nth-child(7) > .bsOFGI > .jmUzTo > .jBlELz > .sc-bqWxrE') + */ }) }) +/* +
+
+