Skip to content

Commit

Permalink
Update tests for new Depositor Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Aug 22, 2023
1 parent a9a56fd commit 71b719e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 31 deletions.
23 changes: 0 additions & 23 deletions client/cypress/e2e/confirm-variables.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,6 @@
cy.get('[data-test="variableRow"]').should('not.exist')
})
})
it('goes back to My Data from Complete button', () => {
cy.on('uncaught:exception', (e, runnable) => {
console.log('error', e)
console.log('runnable', runnable)
return false
})

cy.clearData()
let testfile = 'cypress/fixtures/Fatigue_data.csv'
cy.createAccount('oscar', 'oscar@sesame.com', 'oscar123!')
cy.uploadFile(testfile)
cy.fixture('EyeDemoData.json').then((demoData) => {
cy.url().should('contain', 'my-data')
cy.goToConfirmVariables(demoData.variables)
cy.pause()
// select the variables we will use
cy.selectVariable(demoData.variables)
cy.get('[data-test="wizardCompleteButton"]').click({force:true})
cy.url().should('contain','my-data')
cy.get('[data-test="table status tag"]').should('contain', "Setup Complete")

})
})
it('saves categories correctly', () => {
cy.on('uncaught:exception', (e, runnable) => {
console.log('error', e)
Expand Down
5 changes: 4 additions & 1 deletion client/cypress/e2e/my-analysis-plans.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
cy.goToConfirmVariables(selectVariables)
// select the variables we will use
cy.selectVariable(selectVariables)
cy.get('[data-test="wizardContinueButton"]').last().click({force: true});
cy.get('h1').should('contain', 'Confirm Epsilon')
cy.get('[data-test="wizardCompleteButton"]').click({force:true})
cy.url().should('contain','my-data')
cy.visit('/my-plans')
Expand All @@ -85,7 +87,6 @@
cy.get('[data-test="'+continueTestId+'"]').click({force: true})
cy.url().should('contains','analyst-wizard')
cy.visit('my-data')
cy.pause()

})
})
Expand Down Expand Up @@ -222,6 +223,8 @@
cy.goToConfirmVariables(selectVariables)
// select the variables we will use
cy.selectVariable(selectVariables)
cy.get('[data-test="wizardContinueButton"]').last().click({force: true});
cy.get('h1').should('contain', 'Confirm Epsilon')
cy.get('[data-test="wizardCompleteButton"]').click({force:true})
cy.url().should('contain','my-data')
cy.visit('/my-plans')
Expand Down
12 changes: 6 additions & 6 deletions client/cypress/e2e/validate-variables.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
const minInput = label + ':min'
const maxInput = label + ':max'
// selecting a numeric variable with min/max - test continue button
cy.get('[data-test="wizardCompleteButton"]').should('be.disabled')
cy.get('[data-test="wizardContinueButton"]').should('be.disabled')
cy.contains('td', label).parent('tr').children().first().click()
cy.get('[data-test="' + minInput + '"]').type('0');
cy.get('[data-test="' + maxInput + '"]').type('100');
cy.get('[data-test="' + maxInput + '"]').should('have.value', 100)
cy.get('[data-test="' + maxInput + '"]').trigger('change')
cy.get('[data-test="wizardCompleteButton"]').should('not.be.disabled')
cy.get('[data-test="wizardContinueButton"]').should('not.be.disabled')


})
Expand All @@ -51,19 +51,19 @@

// Select boolean variable without additional information - continueButton should be disabled
cy.contains('td', booleanLabel).parent('tr').children().first().click()
cy.get('[data-test="wizardCompleteButton"]').should('be.disabled')
cy.get('[data-test="wizardContinueButton"]').should('be.disabled')

// leave falseValue blank- continueButton should be disabled
cy.get('[data-test="' + trueValue + '"]').type('1');
cy.get('[data-test="wizardCompleteButton"]').should('be.disabled')
cy.get('[data-test="wizardContinueButton"]').should('be.disabled')

// leave use same value for both fields - continueButton should be disabled
cy.get('[data-test="' + falseValue + '"]').type('1');
cy.get('[data-test="wizardCompleteButton"]').should('be.disabled')
cy.get('[data-test="wizardContinueButton"]').should('be.disabled')

// change true value - continueButton should be enabled
cy.get('[data-test="' + trueValue + '"]').type('2');
cy.get('[data-test="wizardCompleteButton"]').should('not.be.disabled')
cy.get('[data-test="wizardContinueButton"]').should('not.be.disabled')

})

Expand Down
6 changes: 5 additions & 1 deletion client/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Cypress.Commands.add('loadTeacherSurveyDemo', () => {

// select the variables we will use
cy.selectVariable(demoData)
cy.get('[data-test="wizardContinueButton"]').click()
cy.get('h1').should('contain', 'Confirm Epsilon')
cy.get('[data-test="wizardCompleteButton"]').click({force: true})
const planEpsilon = 1
cy.createPlan(planEpsilon, testFile, username)
Expand Down Expand Up @@ -188,6 +190,9 @@ Cypress.Commands.add('runDemo', (testFile, demoDatafile) => {

// select the variables we will use
cy.selectVariable(demoData.variables)
cy.get('[data-test="wizardContinueButton"]').last().click({force: true});
cy.get('h1').should('contain', 'Confirm Epsilon')
cy.get('[data-test="wizardCompleteButton"]').click({force: true})

cy.createStatistics(demoData, testFile,username )

Expand Down Expand Up @@ -309,7 +314,6 @@ Cypress.Commands.add('selectVariable',(demoVariables)=> {

Cypress.Commands.add('createStatistics', (demoData, testFile,username) => {
// Create Analysis plan
cy.get('[data-test="wizardCompleteButton"]').click({force: true})
cy.url().should('contain','my-data')
cy.createPlan(demoData.planEpsilon,testFile,username)
cy.url().should('contain','my-plans')
Expand Down

0 comments on commit 71b719e

Please sign in to comment.