Skip to content

Commit

Permalink
Rqa 3878 tempdeck pd cypress and refactoring of helper functions (#17345
Browse files Browse the repository at this point in the history
)

<!--
Thanks for taking the time to open a Pull Request (PR)! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

GitHub provides robust markdown to format your PR. Links, diagrams,
pictures, and videos along with text formatting make it possible to
create a rich and informative PR. For more information on GitHub
markdown, see:


https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview

This is a refactoring where we are going to execute protocol run steps
through StepExecution (oh and btw it also adds a new module testing e2e
test!)

Each distinct test component (modules, transfer, mix, etc.) will have
its own helper function in support like support/SetupSteps,
support/SupportModules

## Test Plan and Hands on Testing

These are Cypress tests but we might need to collaborate with dev to
handle tests failing because of copy changes .
<!--
Describe your testing of the PR. Emphasize testing not reflected in the
code. Attach protocols, logs, screenshots and any other assets that
support your testing.
-->

## Changelog
Updated testing environment for PD so that way we now can have helper files for each section of our PD code and don't have to copy and paste code across different files. 


<!--
List changes introduced by this PR considering future developers and the
end user. Give careful thought and clear documentation to breaking
changes.
-->

## Review requests
<!--
- What do you need from reviewers to feel confident this PR is ready to
merge?
- Ask questions.
-->

## Risk assessment
Low. 
<!--
- Indicate the level of attention this PR needs.
- Provide context to guide reviewers.
- Discuss trade-offs, coupling, and side effects.
- Look for the possibility, even if you think it's small, that your
change may affect some other part of the system.
- For instance, changing return tip behavior may also change the
behavior of labware calibration.
- How do your unit tests and on hands on testing mitigate this PR's
risks and the risk of future regressions?
- Especially in high risk PRs, explain how you know your testing is
enough.
-->
  • Loading branch information
alexjoel42 authored Jan 27, 2025
1 parent c5a616f commit c6f0f79
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 310 deletions.
99 changes: 99 additions & 0 deletions protocol-designer/cypress/e2e/ProtocolDesignerModulesTest.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { SetupActions, SetupVerifications } from '../support/SetupSteps'
import { UniversalActions } from '../support/universalActions'
import { ModActions, ModVerifications } from '../support/SupportModules'
import { runSteps } from '../support/StepExecution'
import type { StepsList } from '../support/StepExecution'

describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
cy.visit('/')
cy.verifyHomePage()
cy.closeAnalyticsModal()
})

it('content and step 1 flow works', () => {
cy.clickCreateNew()
cy.verifyCreateNewHeader()
const steps: StepsList = [
SetupVerifications.OnStep1,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
SetupActions.SelectOT2,
SetupVerifications.OT2Selected,
UniversalActions.Snapshot,
SetupActions.SelectFlex,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
SetupActions.Confirm,
SetupVerifications.OnStep2,
SetupActions.SingleChannelPipette50,
SetupVerifications.StepTwo50uL,
UniversalActions.Snapshot,
SetupActions.Confirm,
SetupVerifications.StepTwoPart3,
UniversalActions.Snapshot,
SetupActions.Confirm,
SetupVerifications.OnStep3,
SetupActions.YesGripper,
SetupActions.Confirm,
SetupVerifications.Step4Verification,
SetupActions.AddThermocycler,
SetupVerifications.ThermocyclerImg,
SetupActions.AddHeaterShaker,
SetupVerifications.HeaterShakerImg,
SetupActions.AddMagBlock,
SetupVerifications.MagBlockImg,
SetupActions.AddTempdeck2,
SetupVerifications.Tempdeck2Img,
SetupActions.Confirm,
SetupActions.Confirm,
SetupActions.Confirm,
SetupActions.EditProtocolA,
SetupActions.ChoseDeckSlotC2,
SetupActions.AddHardwareLabware,
SetupActions.ClickLabwareHeader,
SetupActions.ClickWellPlatesSection,
SetupActions.SelectArmadillo96WellPlate,
SetupActions.ChoseDeckSlotC2Labware,
SetupActions.AddLiquid,
SetupActions.ClickLiquidButton,
SetupActions.DefineLiquid,
SetupActions.LiquidSaveWIP,
SetupActions.WellSelector,
SetupActions.LiquidDropdown,
SetupVerifications.LiquidPage,
UniversalActions.Snapshot,
SetupActions.SelectLiquidWells,
SetupActions.SetVolumeAndSaveforWells,
SetupActions.ChoseDeckSlotC1,
SetupActions.EditHardwareLabwareOnDeck,
SetupActions.ClickLabwareHeader,
SetupActions.AddAdapters,
SetupActions.DeepWellTempModAdapter,
SetupActions.AddNest96DeepWellPlate,
SetupActions.Done,
SetupActions.ProtocolStepsH,
SetupActions.AddStep,
ModActions.AddTemperatureStep,
ModVerifications.TempeDeckInitialForm,
UniversalActions.Snapshot,
ModActions.ActivateTempdeck,
ModActions.InputTempDeck4,
ModActions.SaveButtonTempdeck,
ModActions.PauseAfterSettingTempdeck,
// ModVerifications.Temp4CPauseTextVerification,
UniversalActions.Snapshot,
SetupActions.AddStep,
ModActions.AddTemperatureStep,
ModActions.ActivateTempdeck,
ModActions.InputTempDeck95,
ModActions.SaveButtonTempdeck,
ModActions.PauseAfterSettingTempdeck,
SetupActions.AddStep,
ModActions.AddTemperatureStep,
ModActions.ActivateTempdeck,
ModActions.InputTempDeck100,
]
runSteps(steps)
})
})
42 changes: 24 additions & 18 deletions protocol-designer/cypress/e2e/createNew.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { Actions, Verifications, runCreateTest } from '../support/createNew'
import { SetupActions, SetupVerifications } from '../support/SetupSteps'
import { UniversalActions } from '../support/universalActions'
import '../support/commands'
// Every test is goign to use StepsList
// Now every test will be a list of some combination of support
// typescript file list of actions for specific PD stuff and include StepsList for steps

import { runSteps } from '../support/StepExecution'
import type { StepsList } from '../support/StepExecution'

describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
Expand All @@ -11,29 +17,29 @@ describe('The Redesigned Create Protocol Landing Page', () => {
it('content and step 1 flow works', () => {
cy.verifyCreateNewHeader()
cy.clickCreateNew()
const steps: Array<Actions | Verifications | UniversalActions> = [
Verifications.OnStep1,
Verifications.FlexSelected,
const steps: StepsList = [
SetupVerifications.OnStep1,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
Actions.SelectOT2,
Verifications.OT2Selected,
SetupActions.SelectOT2,
SetupVerifications.OT2Selected,
UniversalActions.Snapshot,
Actions.SelectFlex,
Verifications.FlexSelected,
SetupActions.SelectFlex,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
Actions.Confirm,
Verifications.OnStep2,
Verifications.NinetySixChannel,
SetupActions.Confirm,
SetupVerifications.OnStep2,
SetupVerifications.NinetySixChannel,
UniversalActions.Snapshot,
Actions.GoBack,
Verifications.OnStep1,
Actions.SelectOT2,
Actions.Confirm,
Verifications.OnStep2,
Verifications.NotNinetySixChannel,
SetupActions.GoBack,
SetupVerifications.OnStep1,
SetupActions.SelectOT2,
SetupActions.Confirm,
SetupVerifications.OnStep2,
SetupVerifications.NotNinetySixChannel,
UniversalActions.Snapshot,
]

runCreateTest(steps)
runSteps(steps)
})
})
107 changes: 55 additions & 52 deletions protocol-designer/cypress/e2e/createNewFlex.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Actions, Verifications, runCreateTest } from '../support/createNew'
import { SetupActions, SetupVerifications } from '../support/SetupSteps'
import { UniversalActions } from '../support/universalActions'
import '../support/commands'
import { runSteps } from '../support/StepExecution'
import type { StepsList } from '../support/StepExecution'

describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
Expand All @@ -10,63 +13,63 @@ describe('The Redesigned Create Protocol Landing Page', () => {
it('content and step 1 flow works', () => {
cy.clickCreateNew()
cy.verifyCreateNewHeader()
const steps: Array<Actions | Verifications | UniversalActions> = [
Verifications.OnStep1,
Verifications.FlexSelected,
const steps: StepsList = [
SetupVerifications.OnStep1,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
Actions.SelectOT2,
Verifications.OT2Selected,
SetupActions.SelectOT2,
SetupVerifications.OT2Selected,
UniversalActions.Snapshot,
Actions.SelectFlex,
Verifications.FlexSelected,
SetupActions.SelectFlex,
SetupVerifications.FlexSelected,
UniversalActions.Snapshot,
Actions.Confirm,
Verifications.OnStep2,
Actions.SingleChannelPipette50,
Verifications.StepTwo50uL,
SetupActions.Confirm,
SetupVerifications.OnStep2,
SetupActions.SingleChannelPipette50,
SetupVerifications.StepTwo50uL,
UniversalActions.Snapshot,
Actions.Confirm,
Verifications.StepTwoPart3,
SetupActions.Confirm,
SetupVerifications.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,
SetupActions.Confirm,
SetupVerifications.OnStep3,
SetupActions.YesGripper,
SetupActions.Confirm,
SetupVerifications.Step4Verification,
SetupActions.AddThermocycler,
SetupVerifications.ThermocyclerImg,
SetupActions.AddHeaterShaker,
SetupVerifications.HeaterShakerImg,
SetupActions.AddMagBlock,
SetupVerifications.MagBlockImg,
SetupActions.AddTempdeck2,
SetupVerifications.Tempdeck2Img,
SetupActions.Confirm,
SetupActions.Confirm,
SetupActions.Confirm,
SetupActions.EditProtocolA,
SetupActions.ChoseDeckSlotC2,
SetupActions.AddHardwareLabware,
SetupActions.ClickLabwareHeader,
SetupActions.ClickWellPlatesSection,
SetupActions.SelectArmadillo96WellPlate,
SetupActions.ChoseDeckSlotC2Labware,
SetupActions.AddLiquid,
SetupActions.ClickLiquidButton,
SetupActions.DefineLiquid,
SetupActions.LiquidSaveWIP,
SetupActions.WellSelector,
SetupActions.LiquidDropdown,
SetupVerifications.LiquidPage,
UniversalActions.Snapshot,
Actions.SelectLiquidWells,
Actions.SetVolumeAndSaveforWells,
Actions.ChoseDeckSlotC3,
Actions.AddHardwareLabware,
Actions.ClickLabwareHeader,
Actions.ClickWellPlatesSection,
Actions.SelectBioRad96WellPlate,
SetupActions.SelectLiquidWells,
SetupActions.SetVolumeAndSaveforWells,
SetupActions.ChoseDeckSlotC3,
SetupActions.AddHardwareLabware,
SetupActions.ClickLabwareHeader,
SetupActions.ClickWellPlatesSection,
SetupActions.SelectBioRad96WellPlate,
]
runCreateTest(steps)
runSteps(steps)
})
})
Loading

0 comments on commit c6f0f79

Please sign in to comment.