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): redesign E2E test beginning #16514

Open
wants to merge 2 commits into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
52 changes: 52 additions & 0 deletions protocol-designer/cypress/e2e/redesignCreateLanding.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
describe('The Redesigned Create Protocol Landing Page', () => {
beforeEach(() => {
cy.visit('/')
cy.enableRedesign()
})

it('step 1 flow works', () => {
cy.contains('button', 'Create a protocol').click()
cy.contains('p', 'Step 1').should('be.visible').should('be.visible')
cy.contains('p', 'Let’s start with the basics').should('be.visible')
cy.contains('p', 'What kind of robot do you have?').should('be.visible')
// Flex is the default
cy.contains('Opentrons Flex').should(
'have.css',
'background-color',
'rgb(0, 108, 250)'
)

cy.contains('Opentrons OT-2').should('be.visible').click()

cy.contains('Opentrons OT-2').should(
'have.css',
'background-color',
'rgb(0, 108, 250)'
)

cy.contains('Opentrons Flex').should('be.visible').click()

cy.contains('Opentrons Flex').should(
'have.css',
'background-color',
'rgb(0, 108, 250)'
)

cy.contains('Confirm').should('be.visible').click()
// a couple validations to validate the click of the confirm button
// takes us to STEP 2
cy.contains('p', 'Step 2').should('be.visible')
cy.contains('Add a pipette').should('be.visible')
// since Flex was selected, validate the 96 channel pipette is visible
cy.contains('96-Channel').should('be.visible')
cy.contains('Go back').should('be.visible').click()
// validate we are back at the landing page
cy.contains('p', 'Step 1').should('be.visible')
// now select the OT-2
cy.contains('Opentrons OT-2').click()
cy.contains('Confirm').click()
// validate we are at step 2
cy.contains('p', 'Step 2').should('be.visible')
cy.contains('96-Channel').should('not.exist')
})
})
14 changes: 14 additions & 0 deletions protocol-designer/cypress/e2e/redesignHome.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('The Redesigned Home Page', () => {
beforeEach(() => {
cy.visit('/')
cy.enableRedesign()
})

it('successfully loads', () => {
cy.title().should('equal', 'Opentrons Protocol Designer')
cy.document().should('have.property', 'charset').and('eq', 'UTF-8')
cy.contains('Welcome to Protocol Designer!')
cy.contains('button', 'Create a protocol').should('be.visible')
cy.contains('label', 'Edit existing protocol').should('be.visible')
})
})
16 changes: 16 additions & 0 deletions protocol-designer/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ Cypress.Commands.add('closeAnnouncementModal', () => {
.click({ force: true })
})

Cypress.Commands.add('enableRedesign', () => {
cy.window().then(win => {
win.enablePrereleaseMode()
})
// You select using the mouse thing on the upper right corner of
// The inspector window
// Use the element name and what's inside it
cy.get('button')
.contains('Got It!')
.should('be.visible')
.click({ force: true })
cy.openSettingsPage()
//
cy.contains('Enable redesign').next().click()
cy.contains('button', 'Continue').click()
})
//
// File Page Actions
//
Expand Down
Loading