Skip to content

Commit

Permalink
Merge pull request #168 from concord-consortium/187949837-add-checks-…
Browse files Browse the repository at this point in the history
…for-iterative-rows

187949837 add checks for iterative rows
  • Loading branch information
nstclair-cc authored Jul 19, 2024
2 parents 38a462e + 1961a2f commit 022f488
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions cypress/integration/branch/experiment.setup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,40 @@ context("Testing Experiment Selection View", () => {
})

describe("Tests Data Trial", () => {

it("collect time series data from (mock) sensor", () => {
it("collect time series data from (mock) sensor for each data row", () => {
// Open a new Data Trial
experimentSetup.openNewExperiment('Data Trial')

sensorData.getExperimentOptionsMenu() // gets the click in the helper function

// Select and verify the "Mocked Sensor: Temperature" option
cy.log('Select and verify mocked sensor')
sensorData.selectMenuOption('Connect')
sensorData.selectSensor('Temperature')
cy.get('div.sensor-module-connectionLabel-vortex select')
.should('have.value', '1')
// Assert the connection status
sensorData.getSensorConnectionStatus()
.should('contain.text', 'Connected: Mocked Sensor')

// Select the sample rate
sensorData.selectSample('100/sec')

// Checks that time series data displays
// for all elements in the table elements
cy.log('checks time series displays for each row')
for (let i = 0; i <= 4; i++) {
sensorData.getDataTrialRow(i).within(() => {
sensorData.getRecordButton().click()
cy.wait(20000) // wait for new sensor values
cy.get('.data-table-field-module-sparkgraphContainer-vortex')
.contains(/10 sec$/)
.should('be.visible')
})
}
})
it("collect time series data from (mock) sensor, confirms UI, delete data trial", () => {
cy.visit(url);
// Constants will check that the input fields are disabled
const labelSelectors = [
'input[placeholder="Label #1"]',
Expand Down Expand Up @@ -174,17 +205,6 @@ context("Testing Experiment Selection View", () => {
cy.wait(5000)
sensorData.getRecordButton().last().click()

// TODO: add checks that time series data displays
// for all elements in the table elements
// Blocker: PT #187949831
// also fix expected to find element 5 error (probably just need x-1)
// for (let i = 0; i <= 5; i++) {
// sensorData.getDataTrialRow(i).within(() => {
// sensorData.getRecordButton().click()
// cy.wait(20000) // wait for new sensor values
// })
// }

cy.log('Delete the trial run')
sensorData.getRecordButton().first().click({force:true})
cy.wait(1000)
Expand Down

0 comments on commit 022f488

Please sign in to comment.