Skip to content

Commit

Permalink
Merge pull request #1374 from concord-consortium/188002783-investigat…
Browse files Browse the repository at this point in the history
…e-flaky-table-tests

188002783 investigate flaky table tests
  • Loading branch information
nstclair-cc authored Jul 26, 2024
2 parents 181b8da + 9543b33 commit f5d06d0
Show file tree
Hide file tree
Showing 18 changed files with 313 additions and 97 deletions.
2 changes: 2 additions & 0 deletions v3/cypress/e2e/adornments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { ToolbarElements as toolbar } from "../support/elements/toolbar-elements

context("Graph adornments", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})

it("shows inspector palette when Display Values button is clicked", () => {
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/attribute-types.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { CfmElements as cfm } from "../support/elements/cfm"

context("attribute types", () => {
beforeEach(() => {
cy.log('Starting test setup')
const filename = "cypress/fixtures/attribute-types.codap"
const url = `${Cypress.config("index")}`
cy.visit(url)
cy.wait(3000)
cfm.openLocalDoc(filename)
cy.log('Setup complete')
})

describe("attribute types are rendered correctly", () => {
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/axis.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ const arrayOfValues = [

context("Test graph axes with various attribute types", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})
it("will show default x axis label", () => {
ah.verifyDefaultAxisLabel("bottom")
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/bivariate-adornments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { ToolbarElements as toolbar } from "../support/elements/toolbar-elements

context("Graph adornments", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})

it("adds a least squares line to graph when Least Squares Line checkbox is checked", () => {
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/calculator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ const calculatorName = "Calculator"

context("Calculator", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500) // Ensuring the page and components are fully loaded.
cy.log('Setup complete')
})
it("populates default title", () => {
c.getComponentTitle("calculator").should("contain", calculatorName)
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/case-card.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

beforeEach(() => {
// cy.scrollTo() doesn't work as expected with `scroll-behavior: smooth`
cy.log('Starting test setup')
const queryParams = "?sample=mammals&scrollBehavior=auto"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2000)
cy.log('Setup complete')
})

context("case card", () => {
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/cfm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { TableTileElements as table } from "../support/elements/table-tile"

context("CloudFileManager", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})
it("Opens Mammals example document via CFM Open dialog", () => {
// hamburger menu is hidden initially
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { ComponentElements as c } from "../support/elements/component-elements"

context("Component UI", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})

it("moves components by dragging", () => {
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/graph-legend.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ const arrayOfValues = [

context("Test legend with various attribute types", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})
it("will not draw legend if plot area is empty", () => {
glh.dragAttributeToPlot(arrayOfAttributes[7]) // Habitat => plot area
Expand Down
16 changes: 12 additions & 4 deletions v3/cypress/e2e/graph.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ const plots = graphRules.plots
// (In local, this works fine and the tests can be run successfully)
context.skip("Test graph plot transitions", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cfm.openLocalDoc("cypress/fixtures/3TableGroups.codap")
cy.wait(2500)
cy.log('Setup complete')
})

plots.forEach(test => {
Expand Down Expand Up @@ -148,14 +150,20 @@ context("Graph UI", () => {
table.getGridCell(2, 2).should("contain", "African Elephant")
cy.log("double-clicking the cell")
// double-click to initiate editing cell
table.getGridCell(3, 4).click().dblclick()
cy.get("[data-testid=cell-text-editor]").type("700{enter}")
table.getGridCell(3, 4).dblclick()
// Wait for the input to appear and then type
table.getGridCell(3, 4).within(() => {
cy.get('input').should('be.visible').type("700{enter}", {force: true})
})

table.getGridCell(2, 2).should("contain", "African Elephant")
cy.log("double-clicking the cell")
// double-click to initiate editing cell
table.getGridCell(3, 5).click().dblclick()
cy.get("[data-testid=cell-text-editor]").type("300{enter}")
table.getGridCell(3, 5).dblclick()
// Wait for the input to appear and then type
table.getGridCell(3, 5).within(() => {
cy.get('input').should('be.visible').type("300{enter}", {force: true})
})

// get the rescale button
c.getComponentTitle("graph").should("have.text", collectionName).click()
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/hierarchical-table.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ const values = hierarchical.attributes

context("hierarchical collections", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})
hierarchical.tests.forEach((h) => {
// FIXME: enable skipped tests
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ const arrayOfAttributes = ["Category", "Educ_Tertiary_Perc", "Inversions"]

context("Map UI", () => {
beforeEach(function () {
cy.log('Starting test setup')
const url = `${Cypress.config("index")}?mouseSensor&noComponentAnimation`
cy.visit(url)
cy.wait(3000)
cy.log('Setup complete')
})

it("verify map title", () => {
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import { WebViewTileElements as webView } from "../support/elements/web-view-til

context("codap plugins", () => {
beforeEach(function () {
cy.log('Starting test setup')
const url = `${Cypress.config("index")}?sample=mammals&dashboard`
cy.visit(url)
cy.log('Setup complete')
})
const openAPITester = () => {
const url='https://concord-consortium.github.io/codap-data-interactives/DataInteractiveAPITester/index.html?lang=en'
Expand Down
2 changes: 2 additions & 0 deletions v3/cypress/e2e/slider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ const newSliderValue = "0.6"

context("Slider UI", () => {
beforeEach(function () {
cy.log('Starting test setup')
const queryParams = "?sample=mammals&dashboard&mouseSensor"
const url = `${Cypress.config("index")}${queryParams}`
cy.visit(url)
cy.wait(2500)
cy.log('Setup complete')
})
it("populates default title, variable name and value", () => {
c.getComponentTitle("slider").should("contain", sliderName)
Expand Down
Loading

0 comments on commit f5d06d0

Please sign in to comment.