Skip to content

Commit

Permalink
remove pipettes select tests from cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
b-cooper committed Feb 9, 2024
1 parent a106330 commit 310a031
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,7 @@ context('Tubes and Rack', () => {
.its('__lastSavedBlobZip__')
.should('be.a', 'blob')
.should(async blob => {
const zipObj = await JSZip.loadAsync(blob)
const labwareDefFile =
zipObj.files['somerackbrand_24_tuberack_1500ul.json']
const labwareDefText = await labwareDefFile.async('text')
const labwareDefText = await blob.async('text')
const savedDef = JSON.parse(labwareDefText)

expectDeepEqual(assert, savedDef, expectedExportLabwareDef)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,15 @@ context('File Import', () => {
cy.window()
.its('__lastSavedBlobZip__')
.should('be.a', 'blob') // wait until we get the blob
.then(blob => jszip.loadAsync(blob)) // load blob into ZipObject
.then(zipObject => {
const jsonFiles = zipObject.file(/.*\.json$/)
expect(jsonFiles).to.have.lengthOf(1)
cy.wrap(jsonFiles[0])
.then(labwareBlob => {
cy.wrap(labwareBlob)
.invoke('async', 'string')
.then(jsonFile => {
cy.fixture(importedLabwareFile).then(expected => {
// TODO(IL, 2020/04/13): use deep equal util from PD cypress tests
expectDeepEqual(assert, JSON.parse(jsonFile), expected)
})
})

const pythonFiles = zipObject.file(/.*\.py$/)
expect(pythonFiles).to.have.lengthOf(1)
cy.wrap(pythonFiles[0].async('string')).then(contents => {
cy.fixture(pythonFileFixture).then(expected => {
expect(contents).to.equal(expected)
})
})
})

cy.window()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,6 @@ context('Reservoirs', () => {
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')

// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,23 +260,6 @@ describe('Create a Tip Rack', () => {
cy.get('input[name="loadName"]').clear().type('generic_1_tiprack_20ul')
})

it('Select the pipette', () => {
cy.get('#Export h2').contains('Labware Test Protocol').should('exist')
cy.get('#react-select-4-input').click()
cy.get('input[name="pipetteName"]')
.invoke('attr', 'value', 'p20_single_gen2')
.should('have.attr', 'value', 'p20_single_gen2')
cy.get('*[class^="Dropdown__option"]')
.contains(/P20.*Single-Channel.*GEN2/)
.click()
cy.get('#DefinitionTest a').contains('tip rack test guide').click()
cy.get('#DefinitionTest a').should(
'have.attr',
'href',
'https://insights.opentrons.com/hubfs/Products/Consumables%20and%20Reagents/labwareDefinition_tipRack_testGuide.pdf'
)
})

it('Verify the exported file to the fixture', () => {
cy.fixture(expectedExportFixture).then(expectedExportLabwareDef => {
cy.get('button').contains('EXPORT FILE').click()
Expand All @@ -285,9 +268,7 @@ describe('Create a Tip Rack', () => {
.its('__lastSavedBlobZip__')
.should('be.a', 'blob')
.should(async blob => {
const zipObj = await JSZip.loadAsync(blob)
const labwareDefFile = zipObj.files['generic_1_tiprack_20ul.json']
const labwareDefText = await labwareDefFile.async('text')
const labwareDefText = await blob.async('text')
const savedDef = JSON.parse(labwareDefText)

expectDeepEqual(assert, savedDef, expectedExportLabwareDef)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,6 @@ context('Tubes and Block', () => {
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')

// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down Expand Up @@ -348,19 +335,6 @@ context('Tubes and Block', () => {
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')

// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down Expand Up @@ -530,20 +504,7 @@ context('Tubes and Block', () => {
cy.get("input[placeholder='testpro_96_aluminumblock_10ul']").should(
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')


// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down Expand Up @@ -710,19 +671,6 @@ context('Tubes and Block', () => {
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')

// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,6 @@ context('Tubes and Rack', () => {
).should('exist')
cy.get("input[placeholder='opentrons_6_tuberack_10ul']").should('exist')

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')

// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down Expand Up @@ -318,19 +305,6 @@ context('Tubes and Rack', () => {
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')

// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down Expand Up @@ -487,20 +461,7 @@ context('Tubes and Rack', () => {
cy.get("input[placeholder='opentrons_24_tuberack_10ul']").should(
'exist'
)

// Test pipette
cy.contains('Test Pipette is a required field').should('exist')
// TODO(IL, 2021-05-15): give Dropdown component semantic selectors for E2E
cy.get('label')
.contains('Test Pipette')
.children()
.first()
.trigger('mousedown')
cy.get('*[class^="Dropdown__option_label"]')
.contains(/P10.*Single-Channel.*GEN1/)
.click()
cy.contains('Test Pipette is a required field').should('not.exist')


// All fields present
cy.get('button[class*="_export_button_"]').click({ force: true })
cy.contains(
Expand Down

0 comments on commit 310a031

Please sign in to comment.