Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(protocol-designer): start of cypress happy path test for mix settings #17320

Merged
merged 40 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4ee94fa
prep for cypress test automation for mix in PD'
skowalski08 Dec 18, 2024
0deebbe
test(change baseurl to localhost): changed the url from sandbox back …
skowalski08 Jan 10, 2025
5cace81
test: remove incorrect file type
skowalski08 Jan 10, 2025
0bb214d
test: added mix settings file and setup steps
skowalski08 Jan 10, 2025
d1d8732
test: added mix settings file and import file for set up
skowalski08 Jan 10, 2025
7b4bbd6
test: added content, locators, and chainable object
skowalski08 Jan 10, 2025
2de5551
Merge branch 'edge' into E2E-PD-mix-settings
skowalski08 Jan 13, 2025
5764922
fix duplicate confirm locators
skowalski08 Jan 13, 2025
c33abc1
Merge branch 'edge' into E2E-PD-mix-settings
skowalski08 Jan 13, 2025
b467943
refactor so that selecting mix and popout are under actions and verif…
skowalski08 Jan 14, 2025
a755f98
clean up comments, added content and verifications
skowalski08 Jan 15, 2025
4b18b81
added input for volume an mix repetitions
skowalski08 Jan 16, 2025
044007d
added select tip handling
skowalski08 Jan 16, 2025
5ff3113
refactor verification of part one mix pop out
skowalski08 Jan 16, 2025
43e18a1
added verifications for part 2 of mix for asp and disp
skowalski08 Jan 16, 2025
e08d71f
remove unnecessary comments
skowalski08 Jan 17, 2025
a42308c
added aspiration setting verifications
skowalski08 Jan 17, 2025
5db76fc
Merge branch 'edge' into E2E-PD-mix-settings
skowalski08 Jan 28, 2025
ef03745
removed duplicate cypress folder and associated files created in open…
skowalski08 Jan 28, 2025
372067f
corrected imports and items in content
skowalski08 Jan 28, 2025
230a9b1
removed unnecessary locator
skowalski08 Jan 28, 2025
b576568
corrected file type
skowalski08 Jan 29, 2025
be29479
updated symbols for mix, verification, and content
skowalski08 Jan 29, 2025
4453822
refactor step execution to work with mix settings
skowalski08 Jan 29, 2025
09e3cf3
added comments with future steps to test as well as verifications
skowalski08 Jan 29, 2025
73359b2
added addition commented out steps
skowalski08 Jan 29, 2025
2c77321
refactor step list to prioritize functional testing
skowalski08 Jan 30, 2025
867646d
refactor step list to prioritize functional testing, added test cover…
skowalski08 Jan 30, 2025
6317987
added dispense delay and blow out
skowalski08 Feb 6, 2025
2f0f423
added touch tip action and verification
skowalski08 Feb 6, 2025
f9f86e4
refactored verifications and added rename action
skowalski08 Feb 7, 2025
00332c1
Merge branch 'edge' into E2E-PD-mix-settings
skowalski08 Feb 7, 2025
4b5096d
Merge branch 'edge' into E2E-PD-mix-settings
skowalski08 Feb 7, 2025
7f53251
eslint fixes
skowalski08 Feb 7, 2025
90f2706
lint fixes
skowalski08 Feb 10, 2025
6b3341a
Merge branch 'edge' into E2E-PD-mix-settings
skowalski08 Feb 10, 2025
e206732
refactor locators and content
skowalski08 Feb 10, 2025
9a5648a
lint fixes
skowalski08 Feb 10, 2025
69574d7
Merge branch 'E2E-PD-mix-settings' of github.com:Opentrons/opentrons …
skowalski08 Feb 10, 2025
e65af76
more lint fixes
skowalski08 Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions protocol-designer/cypress.config.js

This file was deleted.

10 changes: 10 additions & 0 deletions protocol-designer/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'cypress'

Check warning on line 1 in protocol-designer/cypress.config.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress.config.ts#L1

Added line #L1 was not covered by tests

module.exports = defineConfig({
video: false,
viewportWidth: 1440,
viewportHeight: 900,
e2e: {
baseUrl: 'http://localhost:5178',
},
})

Check warning on line 10 in protocol-designer/cypress.config.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress.config.ts#L3-L10

Added lines #L3 - L10 were not covered by tests
77 changes: 77 additions & 0 deletions protocol-designer/cypress/e2e/mixSettings.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import '../support/commands'
import { MixActions, MixVerifications } from '../support/mixSetting'
import { UniversalActions } from '../support/universalActions'
import { TestFilePath, getTestFile } from '../support/testFiles'
import { verifyImportProtocolPage } from '../support/import'
import { runSteps } from '../support/StepExecution'

Check warning on line 6 in protocol-designer/cypress/e2e/mixSettings.cy.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/e2e/mixSettings.cy.ts#L1-L6

Added lines #L1 - L6 were not covered by tests
import type { StepsList } from '../support/StepExecution'

describe('Redesigned Mixing Steps - Happy Path', () => {
beforeEach(() => {
cy.visit('/')
cy.closeAnalyticsModal()
const protocol = getTestFile(TestFilePath.DoItAllV8)
cy.importProtocol(protocol.path)
verifyImportProtocolPage(protocol)

Check warning on line 15 in protocol-designer/cypress/e2e/mixSettings.cy.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/e2e/mixSettings.cy.ts#L9-L15

Added lines #L9 - L15 were not covered by tests

// NOTE: vv make this chunk better//
cy.contains('Edit protocol').click()
cy.contains('Protocol steps').click()
cy.get('[id="AddStepButton"]').contains('Add Step').click()
cy.verifyOverflowBtn()
})

Check warning on line 22 in protocol-designer/cypress/e2e/mixSettings.cy.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/e2e/mixSettings.cy.ts#L18-L22

Added lines #L18 - L22 were not covered by tests

it('It should verify the working function of every permutation of mix checkboxes', () => {
const steps: StepsList = [
MixActions.SelectMix,
UniversalActions.Snapshot,
MixVerifications.PartOne,
MixActions.SelectLabware,
MixActions.SelectWellInputField,
MixVerifications.WellSelectPopout,
UniversalActions.Snapshot,
MixActions.Save,
MixActions.EnterVolume,
MixActions.EnterMixReps,
MixActions.SelectTipHandling,
UniversalActions.Snapshot,
MixActions.Continue,
MixVerifications.PartTwoAsp,
MixActions.AspirateFlowRate,
MixActions.AspWellOrder,
MixVerifications.AspWellOrder,
MixActions.AspMixTipPos,
MixVerifications.AspMixTipPos,
MixActions.Delay,
MixActions.Dispense,
MixVerifications.PartTwoDisp,
MixActions.DispenseFlowRate,
MixActions.Delay,
MixActions.BlowoutLocation,
MixActions.BlowoutFlowRate,
MixActions.BlowoutPosFromTop,
MixVerifications.BlowoutPopout,
MixActions.Save,
MixVerifications.Blowout,
MixActions.TouchTip,
MixVerifications.TouchTipPopout,
MixActions.Save,
MixVerifications.TouchTip,
MixActions.Rename,
MixActions.Save,
MixVerifications.Rename,
MixActions.Save,
]
runSteps(steps)
})
})

Check warning on line 67 in protocol-designer/cypress/e2e/mixSettings.cy.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/e2e/mixSettings.cy.ts#L24-L67

Added lines #L24 - L67 were not covered by tests

/*
To Add:
MixActions.TipPosSideImageMove,
MixActions.TipPosTopImageMove,
MixActions.FlowRateWarning, **for asp and disp

To Change:
Need to refactor labware set up to have different labware on deck for better well selection coverage
*/
14 changes: 14 additions & 0 deletions protocol-designer/cypress/support/StepExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@
executeModSteps,
executeVerifyModStep,
} from './SupportModules'
import {
MixActions,
MixVerifications,
executeMixAction,
executeVerifyMixStep,
} from './mixSetting'

export type StepsList = Array<
| SetupActions
| SetupVerifications
| UniversalActions
| ModActions
| ModVerifications
| MixActions
| MixVerifications
>

export const runSteps = (steps: StepsList): void => {
Expand All @@ -29,6 +37,8 @@
ModVerifications,
SetupVerifications,
UniversalActions,
MixActions,
MixVerifications,

Check warning on line 41 in protocol-designer/cypress/support/StepExecution.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/support/StepExecution.ts#L40-L41

Added lines #L40 - L41 were not covered by tests
]

if (!isEnumValue(enumsToCheck, steps)) {
Expand All @@ -46,6 +56,10 @@
executeModSteps(step as ModActions)
} else if (isEnumValue([ModVerifications], step)) {
executeVerifyModStep(step as ModVerifications)
} else if (isEnumValue([MixActions], step)) {
executeMixAction(step as MixActions)
} else if (isEnumValue([MixVerifications], step)) {
executeVerifyMixStep(step as MixVerifications)

Check warning on line 62 in protocol-designer/cypress/support/StepExecution.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/support/StepExecution.ts#L59-L62

Added lines #L59 - L62 were not covered by tests
}
})
}
25 changes: 23 additions & 2 deletions protocol-designer/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
verifyCreateNewPage: () => Cypress.Chainable<void>
togglePreWetTip: () => Cypress.Chainable<void>
mixaspirate: () => Cypress.Chainable<void>
clickConfirm: () => Cypress.Chainable<void>
verifyOverflowBtn: () => Cypress.Chainable<void>
}
}
}
Expand All @@ -49,6 +51,12 @@
appSettings: 'App Info',
privacy: 'Privacy',
shareSessions: 'Share analytics with Opentrons',
move: 'Move',
transfer: 'Transfer',
mix: 'Mix',
pause: 'Pause',
heaterShaker: 'Heater-shaker',
thermocyler: 'Thermocycler',

Check warning on line 59 in protocol-designer/cypress/support/commands.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/support/commands.ts#L54-L59

Added lines #L54 - L59 were not covered by tests
}

export const locators = {
Expand Down Expand Up @@ -104,11 +112,11 @@
// Home Page
Cypress.Commands.add('verifyHomePage', () => {
cy.contains(content.welcome)
cy.get(locators.privacyPolicy).should('exist').and('be.visible')
cy.get(locators.eula).should('exist').and('be.visible')

Check warning on line 116 in protocol-designer/cypress/support/commands.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/support/commands.ts#L115-L116

Added lines #L115 - L116 were not covered by tests
cy.contains('button', locators.createProtocol).should('be.visible')
cy.contains('label', locators.importProtocol).should('be.visible')
cy.getByTestId(locators.settingsDataTestid).should('be.visible')
cy.get(locators.privacyPolicy).should('exist').and('be.visible')
cy.get(locators.eula).should('exist').and('be.visible')
})

Cypress.Commands.add('clickCreateNew', () => {
Expand All @@ -122,6 +130,10 @@
.click({ force: true })
})

Cypress.Commands.add('clickConfirm', () => {
cy.contains(locators.confirm).click()
})

Check warning on line 135 in protocol-designer/cypress/support/commands.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/support/commands.ts#L133-L135

Added lines #L133 - L135 were not covered by tests

// Header Import
Cypress.Commands.add('importProtocol', (protocolFilePath: string) => {
cy.contains(locators.import).click()
Expand Down Expand Up @@ -158,6 +170,15 @@
.should('be.visible')
})

Cypress.Commands.add('verifyOverflowBtn', () => {
cy.contains(content.move).should('exist').should('be.visible')
cy.contains(content.transfer).should('exist').should('be.visible')
cy.contains(content.mix).should('exist').should('be.visible')
cy.contains(content.pause).should('exist').should('be.visible')
cy.contains(content.heaterShaker).should('exist').should('be.visible')
cy.contains(content.thermocyler).should('exist').should('be.visible')
})

Check warning on line 180 in protocol-designer/cypress/support/commands.ts

View check run for this annotation

Codecov / codecov/patch

protocol-designer/cypress/support/commands.ts#L173-L180

Added lines #L173 - L180 were not covered by tests

/// /////////////////////////////////////////////////////////////////
// Legacy Code Section
// This code is deprecated and should be removed
Expand Down
Loading
Loading