From b5423f7cdfef763b6c0a199322b0e371eeb57256 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Mon, 30 Aug 2021 10:51:41 -0700 Subject: [PATCH 01/53] chore: install clockface beta --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 193cab3ae2..bb11ac5a44 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ }, "dependencies": { "@docsearch/react": "^3.0.0-alpha.37", - "@influxdata/clockface": "^2.11.7", + "@influxdata/clockface": "^3.0.0-beta.4", "@influxdata/flux": "^0.5.1", "@influxdata/flux-lsp-browser": "^0.5.53", "@influxdata/giraffe": "^2.18.0", diff --git a/yarn.lock b/yarn.lock index ea68796805..5cbc726cb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -848,10 +848,10 @@ "@docsearch/css" "3.0.0-alpha.37" algoliasearch "^4.0.0" -"@influxdata/clockface@^2.11.7": - version "2.11.7" - resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-2.11.7.tgz#0a204f66a81fff9a2ed2d24113831e4c4c25f832" - integrity sha512-aifavOC6fEFdeIZAHIxpf8+ieUSB3SGODj0jNTJYqC//gziPkK9V6WQ9ZcmWPlKouqzb6ZXl5elWb1s1j0wszg== +"@influxdata/clockface@^3.0.0-beta.4": + version "3.0.0-beta.4" + resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-3.0.0-beta.4.tgz#e5386ceda225138a316b0cebf6944028c5786196" + integrity sha512-5MlJ/LTv4Eqtd9uWkjQMGB7r25QtmbjsTvsr45Ab6AsGKEGez7YfCHRSE3QVdsmds9yerJlsEToeoFaM0U9A1A== "@influxdata/flux-lsp-browser@^0.5.53": version "0.5.53" From 4d6399e7339ea2e2b78cbf6744bc9228dc68ab04 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Mon, 30 Aug 2021 13:55:19 -0700 Subject: [PATCH 02/53] chore: install clockface beta 5 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bb11ac5a44..5166b79286 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ }, "dependencies": { "@docsearch/react": "^3.0.0-alpha.37", - "@influxdata/clockface": "^3.0.0-beta.4", + "@influxdata/clockface": "^3.0.0-beta.5", "@influxdata/flux": "^0.5.1", "@influxdata/flux-lsp-browser": "^0.5.53", "@influxdata/giraffe": "^2.18.0", diff --git a/yarn.lock b/yarn.lock index 5cbc726cb4..27dc1299f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -848,10 +848,10 @@ "@docsearch/css" "3.0.0-alpha.37" algoliasearch "^4.0.0" -"@influxdata/clockface@^3.0.0-beta.4": - version "3.0.0-beta.4" - resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-3.0.0-beta.4.tgz#e5386ceda225138a316b0cebf6944028c5786196" - integrity sha512-5MlJ/LTv4Eqtd9uWkjQMGB7r25QtmbjsTvsr45Ab6AsGKEGez7YfCHRSE3QVdsmds9yerJlsEToeoFaM0U9A1A== +"@influxdata/clockface@^3.0.0-beta.5": + version "3.0.0-beta.5" + resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-3.0.0-beta.5.tgz#7cb5a0db510f0af4ff25535d19364401ef659e94" + integrity sha512-A3RKlgT2FPM0voMScaVkFDCceAukzXp+BrEd/BTuhOBe2dsc3k9Mg6vMwM7sOLiB3TRrXXCWJdzpVQngnIOdmw== "@influxdata/flux-lsp-browser@^0.5.53": version "0.5.53" From f2e32d4862fe81488ecde2bc8936d05a272291e4 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Mon, 30 Aug 2021 10:51:41 -0700 Subject: [PATCH 03/53] chore: install clockface beta --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 193cab3ae2..bb11ac5a44 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ }, "dependencies": { "@docsearch/react": "^3.0.0-alpha.37", - "@influxdata/clockface": "^2.11.7", + "@influxdata/clockface": "^3.0.0-beta.4", "@influxdata/flux": "^0.5.1", "@influxdata/flux-lsp-browser": "^0.5.53", "@influxdata/giraffe": "^2.18.0", diff --git a/yarn.lock b/yarn.lock index ea68796805..5cbc726cb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -848,10 +848,10 @@ "@docsearch/css" "3.0.0-alpha.37" algoliasearch "^4.0.0" -"@influxdata/clockface@^2.11.7": - version "2.11.7" - resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-2.11.7.tgz#0a204f66a81fff9a2ed2d24113831e4c4c25f832" - integrity sha512-aifavOC6fEFdeIZAHIxpf8+ieUSB3SGODj0jNTJYqC//gziPkK9V6WQ9ZcmWPlKouqzb6ZXl5elWb1s1j0wszg== +"@influxdata/clockface@^3.0.0-beta.4": + version "3.0.0-beta.4" + resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-3.0.0-beta.4.tgz#e5386ceda225138a316b0cebf6944028c5786196" + integrity sha512-5MlJ/LTv4Eqtd9uWkjQMGB7r25QtmbjsTvsr45Ab6AsGKEGez7YfCHRSE3QVdsmds9yerJlsEToeoFaM0U9A1A== "@influxdata/flux-lsp-browser@^0.5.53": version "0.5.53" From e195e12a0e5fca8804963c38013fc35d0fa35008 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Mon, 30 Aug 2021 13:55:19 -0700 Subject: [PATCH 04/53] chore: install clockface beta 5 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bb11ac5a44..5166b79286 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ }, "dependencies": { "@docsearch/react": "^3.0.0-alpha.37", - "@influxdata/clockface": "^3.0.0-beta.4", + "@influxdata/clockface": "^3.0.0-beta.5", "@influxdata/flux": "^0.5.1", "@influxdata/flux-lsp-browser": "^0.5.53", "@influxdata/giraffe": "^2.18.0", diff --git a/yarn.lock b/yarn.lock index 5cbc726cb4..27dc1299f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -848,10 +848,10 @@ "@docsearch/css" "3.0.0-alpha.37" algoliasearch "^4.0.0" -"@influxdata/clockface@^3.0.0-beta.4": - version "3.0.0-beta.4" - resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-3.0.0-beta.4.tgz#e5386ceda225138a316b0cebf6944028c5786196" - integrity sha512-5MlJ/LTv4Eqtd9uWkjQMGB7r25QtmbjsTvsr45Ab6AsGKEGez7YfCHRSE3QVdsmds9yerJlsEToeoFaM0U9A1A== +"@influxdata/clockface@^3.0.0-beta.5": + version "3.0.0-beta.5" + resolved "https://registry.yarnpkg.com/@influxdata/clockface/-/clockface-3.0.0-beta.5.tgz#7cb5a0db510f0af4ff25535d19364401ef659e94" + integrity sha512-A3RKlgT2FPM0voMScaVkFDCceAukzXp+BrEd/BTuhOBe2dsc3k9Mg6vMwM7sOLiB3TRrXXCWJdzpVQngnIOdmw== "@influxdata/flux-lsp-browser@^0.5.53": version "0.5.53" From bbdb5b4e3b20c6157ad4bac7c12a656794329985 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Tue, 31 Aug 2021 12:11:10 -0400 Subject: [PATCH 05/53] chore: fix navigation tests (new navigation has diff quirks) --- cypress/e2e/shared/nav.test.ts | 39 ++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/cypress/e2e/shared/nav.test.ts b/cypress/e2e/shared/nav.test.ts index 4e14071935..95e4cd4ab1 100644 --- a/cypress/e2e/shared/nav.test.ts +++ b/cypress/e2e/shared/nav.test.ts @@ -9,31 +9,36 @@ describe('navigation', () => { it('can navigate to each page from left nav', () => { // Load Data Page - cy.getByTestID('nav-item-load-data').click() + cy.getByTestID('nav-item-load-data').click({force: true}) + cy.getByTestID('tabs').within(() => { + // buckets tab + cy.get('[id="buckets"]').click() + cy.url().should('contain', 'buckets') + }) cy.getByTestID('load-data--header').should('exist') // Data Explorer Page - cy.getByTestID('nav-item-data-explorer').click() + cy.getByTestID('nav-item-data-explorer').click({force: true}) cy.getByTestID('data-explorer--header').should('exist') // Dashboard Index Page - cy.getByTestID('nav-item-dashboards').click() + cy.getByTestID('nav-item-dashboards').click({force: true}) cy.getByTestID('empty-dashboards-list').should('exist') // Tasks Index Page - cy.getByTestID('nav-item-tasks').click() + cy.getByTestID('nav-item-tasks').click({force: true}) cy.getByTestID('tasks-page--header').should('exist') // Alerts Page - cy.getByTestID('nav-item-alerting').click() + cy.getByTestID('nav-item-alerting').click({force: true}) cy.getByTestID('alerts-page--header').should('exist') // Settings Page - cy.getByTestID('nav-item-settings').click() + cy.getByTestID('nav-item-settings').click({force: true}) cy.getByTestID('settings-page--header').should('exist') // Home Page - cy.getByTestID('tree-nav--header').click() + cy.getByTestID('tree-nav--header').click({force: true}) cy.getByTestID('home-page--header').should('exist') // 404 @@ -98,7 +103,7 @@ describe('navigation', () => { }) it('can navigate in tabs of data page', () => { - cy.getByTestID('nav-item-load-data').click() + cy.getByTestID('nav-item-load-data').click({force: true}) cy.getByTestID('tabs').within(() => { // buckets tab @@ -133,21 +138,21 @@ describe('navigation', () => { } it('can navigate in tabs of settings page', () => { - cy.getByTestID('nav-item-settings').click() + cy.getByTestID('nav-item-settings').click({force: true}) exploreTabs(['templates', 'labels', 'variables']) }) it('can navigate in tabs of collapsed alerts page', () => { - cy.getByTestID('nav-item-alerting').click() + cy.getByTestID('nav-item-alerting').click({force: true}) ;['checks', 'endpoints', 'rules'].forEach(tab => { cy.getByTestID(`alerting-tab--${tab}`).click() cy.getByTestID(`alerting-tab--${tab}--input`).should('to.be', 'checked') }) }) - it('can navigate in tabs from maximized left tree nav', () => { + it.only('can navigate in tabs from maximized left tree nav', () => { // TODO: check if nav is already maximized - cy.get('.cf-tree-nav--toggle').click() + cy.get('.cf-tree-nav--toggle').click({force: true}) ;[ 'sources', 'buckets', @@ -158,12 +163,20 @@ describe('navigation', () => { 'templates', 'labels', ].forEach(x => { + if (x === 'history') { + cy.getByTestID('nav-item-alerting').click({force: true}) + } else if (x === 'variables' || 'templates' || 'labels') { + cy.getByTestID('nav-item-settings').click({force: true}) + } else { + cy.getByTestID('nav-item-load-data').click({force: true}) + } + cy.getByTestID(`nav-subitem-${x}`) .last() .click() cy.url().should('contain', x) }) - cy.get('.cf-tree-nav--toggle').click() + cy.get('.cf-tree-nav--toggle').click({force: true}) }) }) From 6b74b40b69da56a0070346ac1d04f16c6472d70b Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Tue, 31 Aug 2021 12:15:07 -0400 Subject: [PATCH 06/53] chore: remove the only flag in nav test --- cypress/e2e/shared/nav.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/nav.test.ts b/cypress/e2e/shared/nav.test.ts index 95e4cd4ab1..a9e14a60a4 100644 --- a/cypress/e2e/shared/nav.test.ts +++ b/cypress/e2e/shared/nav.test.ts @@ -150,7 +150,7 @@ describe('navigation', () => { }) }) - it.only('can navigate in tabs from maximized left tree nav', () => { + it('can navigate in tabs from maximized left tree nav', () => { // TODO: check if nav is already maximized cy.get('.cf-tree-nav--toggle').click({force: true}) ;[ From 94935a9a0ebf3003e561406021528bc5196f6a7c Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 10:18:47 -0700 Subject: [PATCH 07/53] fix: lint errors --- cypress/e2e/shared/nav.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/shared/nav.test.ts b/cypress/e2e/shared/nav.test.ts index a9e14a60a4..10728a50b7 100644 --- a/cypress/e2e/shared/nav.test.ts +++ b/cypress/e2e/shared/nav.test.ts @@ -164,11 +164,11 @@ describe('navigation', () => { 'labels', ].forEach(x => { if (x === 'history') { - cy.getByTestID('nav-item-alerting').click({force: true}) - } else if (x === 'variables' || 'templates' || 'labels') { - cy.getByTestID('nav-item-settings').click({force: true}) + cy.getByTestID('nav-item-alerting').click() + } else if (x === 'variables' || x === 'templates' || x === 'labels') { + cy.getByTestID('nav-item-settings').click() } else { - cy.getByTestID('nav-item-load-data').click({force: true}) + cy.getByTestID('nav-item-load-data').click() } cy.getByTestID(`nav-subitem-${x}`) @@ -177,6 +177,6 @@ describe('navigation', () => { cy.url().should('contain', x) }) - cy.get('.cf-tree-nav--toggle').click({force: true}) + cy.get('.cf-tree-nav--toggle').click() }) }) From 43c336fc8fa0befc37a910559119f02e45e3d905 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 11:46:33 -0700 Subject: [PATCH 08/53] fix: flows test --- cypress/e2e/shared/flows.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/flows.test.ts b/cypress/e2e/shared/flows.test.ts index fbe6ce0007..6bf8e4c573 100644 --- a/cypress/e2e/shared/flows.test.ts +++ b/cypress/e2e/shared/flows.test.ts @@ -369,6 +369,6 @@ describe('Flows', () => { cy.getByTestID('resource-editable-name').click() // visualizations should exist - cy.getByTestID('giraffe-inner-plot').should('be.visible') + cy.getByTestID('giraffe-inner-plot').should('exist') }) }) From d5e07b921f712dff648a50a76c2a274cb52b8552 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 13:14:46 -0700 Subject: [PATCH 09/53] fix: explorerVisualizations.test --- src/timeMachine/components/TimeMachine.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timeMachine/components/TimeMachine.tsx b/src/timeMachine/components/TimeMachine.tsx index 31796387c9..510ebf242a 100644 --- a/src/timeMachine/components/TimeMachine.tsx +++ b/src/timeMachine/components/TimeMachine.tsx @@ -18,7 +18,7 @@ import {getActiveTimeMachine} from 'src/timeMachine/selectors' import {AppState, TimeMachineTab} from 'src/types' import ErrorBoundary from 'src/shared/components/ErrorBoundary' -const INITIAL_RESIZER_HANDLE = 0.5 +const INITIAL_RESIZER_HANDLE = 0.35 interface StateProps { activeTab: TimeMachineTab From 6067b51c708000908b9861894b6243161ffa1d0d Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Tue, 31 Aug 2021 17:06:58 -0400 Subject: [PATCH 10/53] chore: fix variables test by adding scroll into view for label creation --- cypress/e2e/shared/variables.test.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/shared/variables.test.ts b/cypress/e2e/shared/variables.test.ts index 1e48bb3238..fd4ca3c944 100644 --- a/cypress/e2e/shared/variables.test.ts +++ b/cypress/e2e/shared/variables.test.ts @@ -343,7 +343,9 @@ describe('Variables', () => { cy.getByTestID('inline-labels--popover--contents').type(labelName) cy.getByTestID('inline-labels--create-new').click() - cy.getByTestID('create-label-form--submit').should('be.visible') + cy.getByTestID('create-label-form--submit') + .scrollIntoView() + .should('be.visible') cy.getByTestID('create-label-form--submit').click() cy.getByTestID('overlay--children').should('not.exist') @@ -451,7 +453,9 @@ describe('Variables', () => { .clickAttached() cy.getByTestID('inline-labels--popover--contents').type(firstLabelName) cy.getByTestID('inline-labels--create-new').click() - cy.getByTestID('create-label-form--submit').should('be.visible') + cy.getByTestID('create-label-form--submit') + .scrollIntoView() + .should('be.visible') cy.getByTestID('create-label-form--submit').click() const secondLabelName = 'query' @@ -460,7 +464,9 @@ describe('Variables', () => { .clickAttached() cy.getByTestID('inline-labels--popover--contents').type(secondLabelName) cy.getByTestID('inline-labels--create-new').click() - cy.getByTestID('create-label-form--submit').should('be.visible') + cy.getByTestID('create-label-form--submit') + .scrollIntoView() + .should('be.visible') cy.getByTestID('create-label-form--submit').click() const thirdLabelName = 'csv' @@ -469,7 +475,9 @@ describe('Variables', () => { .clickAttached() cy.getByTestID('inline-labels--popover--contents').type(thirdLabelName) cy.getByTestID('inline-labels--create-new').click() - cy.getByTestID('create-label-form--submit').should('be.visible') + cy.getByTestID('create-label-form--submit') + .scrollIntoView() + .should('be.visible') cy.getByTestID('create-label-form--submit').click() // Select ascending order and use filter on variable name From 5d3d112e9eb54e2ca205db68e88b1fdb5d1c8a4b Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Tue, 31 Aug 2021 17:29:40 -0400 Subject: [PATCH 11/53] chore: fix test in variables by adding force true to navigation item click --- cypress/e2e/shared/variables.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/variables.test.ts b/cypress/e2e/shared/variables.test.ts index fd4ca3c944..4cb5fab3e9 100644 --- a/cypress/e2e/shared/variables.test.ts +++ b/cypress/e2e/shared/variables.test.ts @@ -18,7 +18,7 @@ describe('Variables', () => { it('can CRUD a CSV, upload, map, and query variable and search for variables based on names', () => { // Navigate away from and back to variables index using the nav bar cy.getByTestID('nav-item-dashboards').click() - cy.getByTestID('nav-item-settings').click() + cy.getByTestID('nav-item-settings').click({force: true}) cy.getByTestID('templates--tab').click() cy.getByTestID('variables--tab').click() From 2f25509acd0da102cac8f8615dfcf145be2654ad Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 14:34:05 -0700 Subject: [PATCH 12/53] fix: dashboardsIndex.test.ts --- cypress/e2e/shared/dashboardsIndex.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/shared/dashboardsIndex.test.ts b/cypress/e2e/shared/dashboardsIndex.test.ts index 0261004f8b..ded397d380 100644 --- a/cypress/e2e/shared/dashboardsIndex.test.ts +++ b/cypress/e2e/shared/dashboardsIndex.test.ts @@ -314,12 +314,12 @@ describe('Dashboards', () => { // visit another page cy.getByTestID('tree-nav').then(() => { - cy.contains('Settings').click() + cy.contains('Settings').click({force: true}) cy.contains( "Looks like there aren't any Variables, why not create one?" ) // return to dashboards page - cy.contains('Boards').click() + cy.contains('Dashboards').click() }) // assert dashboard order remains the same From 90419d950fa87ba81b2d4251158a0108e7ba648f Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 14:55:54 -0700 Subject: [PATCH 13/53] fix: explorer.test.ts --- cypress/e2e/shared/explorer.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/shared/explorer.test.ts b/cypress/e2e/shared/explorer.test.ts index 74144e8870..f30ad748ed 100644 --- a/cypress/e2e/shared/explorer.test.ts +++ b/cypress/e2e/shared/explorer.test.ts @@ -55,7 +55,7 @@ describe('DataExplorer', () => { cy.contains(fluxCode) }) - it('can navigate to data explorer from buckets list and override state', () => { + it.only('can navigate to data explorer from buckets list and override state', () => { const fluxCode = 'from(bucket: "_monitoring")' cy.getByTestID('switch-to-script-editor').click() cy.get('.flux-editor').within(() => { @@ -66,6 +66,7 @@ describe('DataExplorer', () => { cy.get('.cf-tree-nav--toggle').click() // Can't use the testID to select this nav item because Clockface is silly and uses the same testID twice // Issue: https://github.com/influxdata/clockface/issues/539 + cy.getByTestID('nav-item-load-data').click() cy.get('.cf-tree-nav--sub-item-label') .contains('Buckets') .click() From c45ca9e2e32ad8fd2cecb57eb2d2869d46ae2cc2 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 14:56:12 -0700 Subject: [PATCH 14/53] fix: explorer.test.ts remove only --- cypress/e2e/shared/explorer.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/explorer.test.ts b/cypress/e2e/shared/explorer.test.ts index f30ad748ed..48b6265048 100644 --- a/cypress/e2e/shared/explorer.test.ts +++ b/cypress/e2e/shared/explorer.test.ts @@ -55,7 +55,7 @@ describe('DataExplorer', () => { cy.contains(fluxCode) }) - it.only('can navigate to data explorer from buckets list and override state', () => { + it('can navigate to data explorer from buckets list and override state', () => { const fluxCode = 'from(bucket: "_monitoring")' cy.getByTestID('switch-to-script-editor').click() cy.get('.flux-editor').within(() => { From 9da01b6c6a43568f2cac6c54ea4f1be5224095f1 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 31 Aug 2021 15:19:46 -0700 Subject: [PATCH 15/53] fix: explorer.test.ts rename and remove second query --- cypress/e2e/shared/explorer.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/explorer.test.ts b/cypress/e2e/shared/explorer.test.ts index 48b6265048..e70b92f886 100644 --- a/cypress/e2e/shared/explorer.test.ts +++ b/cypress/e2e/shared/explorer.test.ts @@ -647,7 +647,7 @@ describe('DataExplorer', () => { // rename the first tab cy.get('.query-tab') .first() - .trigger('contextmenu') + .trigger('contextmenu', {force: true}) cy.getByTestID('right-click--edit-tab').click() cy.getByTestID('edit-query-name').type('NewName{enter}') cy.get('.query-tab') From 635b0f6c1050155c5c7c008d3390d4bde2e77c14 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Wed, 1 Sep 2021 11:01:01 -0400 Subject: [PATCH 16/53] chore: fix annotations test by making cypress press enter after typing cell name --- cypress/e2e/util/annotationsSetup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/util/annotationsSetup.ts b/cypress/e2e/util/annotationsSetup.ts index 0f6621646b..dd6c2b2a20 100644 --- a/cypress/e2e/util/annotationsSetup.ts +++ b/cypress/e2e/util/annotationsSetup.ts @@ -54,7 +54,7 @@ export const setupData = (cy: Cypress.Chainable, plotTypeSuffix = '') => { cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) From a9494b5824bc1958b0e1bf42002909f3ff42db53 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 10:45:45 -0700 Subject: [PATCH 17/53] fix: dashboardsRefresh.test.ts --- cypress/e2e/shared/dashboardsRefresh.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index 040536ac07..20dffe1789 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -60,7 +60,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) }) @@ -256,7 +256,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) @@ -453,7 +453,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) From 3ae2f75d3f3d4f9ae373e36fac8480626ef48c9c Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 10:46:33 -0700 Subject: [PATCH 18/53] fix: dashboardsRefresh.test.ts --- cypress/e2e/shared/dashboardsRefresh.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index 20dffe1789..66d4343edd 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -355,7 +355,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) @@ -539,7 +539,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) From 83c75a78d4ec620d3e73c32c87ff0bb444202212 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 11:36:04 -0700 Subject: [PATCH 19/53] fix: legends.test.ts --- cypress/e2e/shared/legends.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/legends.test.ts b/cypress/e2e/shared/legends.test.ts index e9eae5ee49..91709f3570 100644 --- a/cypress/e2e/shared/legends.test.ts +++ b/cypress/e2e/shared/legends.test.ts @@ -478,7 +478,7 @@ describe('Legends', () => { cy.getByTestID('overlay').within(() => { cy.getByTestID('page-header') .click() - .type(cellName) + .type(cellName+'{enter}') }) // Without submitting the query, save it to a dashboard From 91c3a697fb62713e2ddfc3c9818cec05e1b9fdb2 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 11:49:27 -0700 Subject: [PATCH 20/53] fix: prettier --- cypress/e2e/shared/dashboardsView.test.ts | 2 +- cypress/e2e/shared/legends.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/shared/dashboardsView.test.ts b/cypress/e2e/shared/dashboardsView.test.ts index 07da8074eb..2c25fbbd65 100644 --- a/cypress/e2e/shared/dashboardsView.test.ts +++ b/cypress/e2e/shared/dashboardsView.test.ts @@ -1283,7 +1283,7 @@ csv.from(csv: data) |> filter(fn: (r) => r.bucket == v.bucketsCSV)` cy.getByTestID('page-title').click() cy.getByTestID('renamable-page-title--input') .clear() - .type('blah') + .type('blah{enter}') cy.getByTestID('save-cell--button').click() }) cy.getByTestID('cell-context--toggle') diff --git a/cypress/e2e/shared/legends.test.ts b/cypress/e2e/shared/legends.test.ts index 91709f3570..7de4bf65dd 100644 --- a/cypress/e2e/shared/legends.test.ts +++ b/cypress/e2e/shared/legends.test.ts @@ -478,7 +478,7 @@ describe('Legends', () => { cy.getByTestID('overlay').within(() => { cy.getByTestID('page-header') .click() - .type(cellName+'{enter}') + .type(cellName + '{enter}') }) // Without submitting the query, save it to a dashboard From 491525a12c4926665b54e8dc5f60fd9a41661b4f Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Wed, 1 Sep 2021 15:42:44 -0400 Subject: [PATCH 21/53] chore: fix dashboard views test --- cypress/e2e/shared/dashboardsView.test.ts | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/shared/dashboardsView.test.ts b/cypress/e2e/shared/dashboardsView.test.ts index 2c25fbbd65..7febaf9ed4 100644 --- a/cypress/e2e/shared/dashboardsView.test.ts +++ b/cypress/e2e/shared/dashboardsView.test.ts @@ -66,6 +66,7 @@ describe('Dashboard', () => { cy.getByTestID('renamable-page-title--input') .clear() .type(xyCellName) + .type('{enter}') cy.getByTestID('save-cell--button').click() }) diff --git a/package.json b/package.json index 5166b79286..3f4b7830d6 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "test:e2e:clean": "rm junit-results/*.xml", "test:e2e:all": "yarn test:e2e:clean && yarn test:e2e; yarn test:e2e:report;", "test:e2e:kind": "CYPRESS_dexUrl=http://dex-twodotoh.a.influxcloud.dev.local CYPRESS_baseUrl=https://twodotoh.a.influxcloud.dev.local CYPRESS_password=password cypress open --browser chrome --config chromeWebSecurity=false", - "test:e2e:remocal": "CYPRESS_dexUrl=https://dex-${NS}.a.influxcloud.dev.local CYPRESS_baseUrl=https://${NS}.a.influxcloud.dev.local CYPRESS_password=password cypress open --browser chrome --config chromeWebSecurity=false", + "test:e2e:remocal": "CYPRESS_dexUrl=https://dex-twodotoh-dev-${NS}.a.influxcloud.dev.local CYPRESS_baseUrl=https://twodotoh-dev-${NS}.a.influxcloud.dev.local CYPRESS_password=password cypress open --browser chrome --config chromeWebSecurity=false", "test:circleci": "yarn run test:ci --maxWorkers=2", "test:ci": "JEST_JUNIT_OUTPUT_DIR=\"./coverage\" jest --ci --coverage", "lint": "yarn tsc && yarn prettier && yarn eslint", From dedae49c9bd76dd4e3901bf3d851f561a6d5d647 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 14:46:58 -0700 Subject: [PATCH 22/53] fix: dashboardsRefresh.test.ts --- cypress/e2e/shared/dashboardsRefresh.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index 66d4343edd..5164786cd5 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -295,7 +295,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('auto-refresh-input') .clear() .type('2s') - cy.getByTestID('refresh-form-activate-button').click() + cy.getByTestID('refresh-form-activate-button').click({force: true}) cy.wait('@secondCellQuery') cy.wait('@firstCellQuery') @@ -393,7 +393,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('auto-refresh-input') .clear() .type('2s') - cy.getByTestID('refresh-form-activate-button').click() + cy.getByTestID('refresh-form-activate-button').click({force: true}) cy.wait('@secondCellQuery') cy.getByTestID('cell blah').within(() => { From 6bb56d1892a93684a97940beedd930142a256da4 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Wed, 1 Sep 2021 18:28:42 -0400 Subject: [PATCH 23/53] chore: update to new beta version which has the customFocus prop on dropdown, which lets us disable out of the box dropdown focus behavior for typeahead dropdown --- package.json | 2 +- src/variables/components/TypeAheadVariableDropdown.tsx | 1 + yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3f4b7830d6..f2f1990d4e 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ }, "dependencies": { "@docsearch/react": "^3.0.0-alpha.37", - "@influxdata/clockface": "^3.0.0-beta.5", + "@influxdata/clockface": "^3.0.0-beta.6", "@influxdata/flux": "^0.5.1", "@influxdata/flux-lsp-browser": "^0.5.53", "@influxdata/giraffe": "^2.18.0", diff --git a/src/variables/components/TypeAheadVariableDropdown.tsx b/src/variables/components/TypeAheadVariableDropdown.tsx index eed1d24a25..d2e965b73f 100644 --- a/src/variables/components/TypeAheadVariableDropdown.tsx +++ b/src/variables/components/TypeAheadVariableDropdown.tsx @@ -284,6 +284,7 @@ class TypeAheadVariableDropdown extends PureComponent { testID={this.props.testID || `variable-dropdown--${name}`} onClickAway={this.onClickAwayHere} menuOpen={menuOpen} + customFocus button={(active, onClick) => ( Date: Wed, 1 Sep 2021 22:11:14 -0700 Subject: [PATCH 24/53] fix: simpleTable tests --- cypress/e2e/shared/simpleTable.test.ts | 2 ++ src/timeMachine/components/TimeMachine.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/shared/simpleTable.test.ts b/cypress/e2e/shared/simpleTable.test.ts index 548222333c..ccb5702cef 100644 --- a/cypress/e2e/shared/simpleTable.test.ts +++ b/cypress/e2e/shared/simpleTable.test.ts @@ -6,6 +6,8 @@ describe('simple table interactions', () => { const simpleLarge = 'simple-large' const simpleOverflow = 'simple-overflow' beforeEach(() => { + // to fit all the elements in screen we force a view port size + cy.viewport(1200, 1000) cy.flush() cy.signin().then(() => { cy.get('@org').then(({id: orgID}: Organization) => { diff --git a/src/timeMachine/components/TimeMachine.tsx b/src/timeMachine/components/TimeMachine.tsx index 510ebf242a..3ded8541da 100644 --- a/src/timeMachine/components/TimeMachine.tsx +++ b/src/timeMachine/components/TimeMachine.tsx @@ -18,7 +18,7 @@ import {getActiveTimeMachine} from 'src/timeMachine/selectors' import {AppState, TimeMachineTab} from 'src/types' import ErrorBoundary from 'src/shared/components/ErrorBoundary' -const INITIAL_RESIZER_HANDLE = 0.35 +const INITIAL_RESIZER_HANDLE = 0.30 interface StateProps { activeTab: TimeMachineTab From 49b80ba488cf493263d1102545bd6f39bbd0ea50 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 22:13:24 -0700 Subject: [PATCH 25/53] fix: prettier --- src/timeMachine/components/TimeMachine.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timeMachine/components/TimeMachine.tsx b/src/timeMachine/components/TimeMachine.tsx index 3ded8541da..d8ab49a991 100644 --- a/src/timeMachine/components/TimeMachine.tsx +++ b/src/timeMachine/components/TimeMachine.tsx @@ -18,7 +18,7 @@ import {getActiveTimeMachine} from 'src/timeMachine/selectors' import {AppState, TimeMachineTab} from 'src/types' import ErrorBoundary from 'src/shared/components/ErrorBoundary' -const INITIAL_RESIZER_HANDLE = 0.30 +const INITIAL_RESIZER_HANDLE = 0.3 interface StateProps { activeTab: TimeMachineTab From 9b803c775edae20c04f0503b8e05fa076a7a38cf Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Wed, 1 Sep 2021 23:03:38 -0700 Subject: [PATCH 26/53] fix: more tests --- cypress/e2e/shared/dashboardsRefresh.test.ts | 2 +- cypress/e2e/shared/explorerVisualizations.test.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index 5164786cd5..c3b14c76e7 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -73,7 +73,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('auto-refresh-input') .clear() .type('2s') - cy.getByTestID('refresh-form-activate-button').click() + cy.getByTestID('refresh-form-activate-button').click({force: true}) cy.wait('@refreshQuery') cy.getByTestID('enable-auto-refresh-button').click() // Wait the duration we'd expect on the next query to ensure stopping via the button actually stops the process. The fail means the request didn't run, which is what we want diff --git a/cypress/e2e/shared/explorerVisualizations.test.ts b/cypress/e2e/shared/explorerVisualizations.test.ts index 147ccbd4be..a5dab78c78 100644 --- a/cypress/e2e/shared/explorerVisualizations.test.ts +++ b/cypress/e2e/shared/explorerVisualizations.test.ts @@ -415,6 +415,8 @@ describe('visualizations', () => { }) it('can view table data & scroll to bottom', () => { + // to fit all the elements in screen we force a view port size + cy.viewport(1200, 1000) // build the query to return data from beforeEach cy.getByTestID(`selector-list m`).click() cy.getByTestID('selector-list v').click() From 9e25cb48504ded6d2eca05345a9748fc489ccea8 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Thu, 2 Sep 2021 12:14:49 -0400 Subject: [PATCH 27/53] chore: fix autorefresh tests by adding keyboard enter listening logic to duration input --- cypress/e2e/shared/dashboardsRefresh.test.ts | 9 ++++++--- src/shared/components/DurationInput.tsx | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index c3b14c76e7..11fe97ece3 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -91,6 +91,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('auto-refresh-input') .clear() .type('4s') + .type('{enter}') cy.getByTestID('timerange-popover-button').click() cy.getByTestID('timerange-popover--dialog').within(() => { cy.getByTestID('timerange--input') @@ -119,6 +120,7 @@ describe('Dashboard refresh', () => { cy.getByTestID('auto-refresh-input') .clear() .type('2s') + .type('{enter}') cy.getByTestID('timerange-popover-button').click() cy.getByTestID('timerange-popover--dialog').within(() => { cy.getByTestID('timerange--input') @@ -155,14 +157,15 @@ describe('Dashboard refresh', () => { cy.wait('@refreshQuery') cy.wait(5000) cy.getByTestID('enable-auto-refresh-button').then(el => { - expect(el[0].innerText).to.equal('Enable Auto Refresh') + expect(el[0].innerText.toLowerCase()).to.equal('enable auto refresh') }) }) - it('can timeout on a preset inactivity timeout', done => { + it.only('can timeout on a preset inactivity timeout', done => { cy.getByTestID('enable-auto-refresh-button').click() cy.getByTestID('auto-refresh-input') .clear() .type('3s') + .type('{enter}') cy.getByTestID('timerange-popover-button').click() cy.getByTestID('timerange-popover--dialog').within(() => { cy.getByTestID('timerange--input') @@ -188,7 +191,7 @@ describe('Dashboard refresh', () => { cy.wait(3100) cy.getByTestID('enable-auto-refresh-button').then(el => { - expect(el[0].innerText).to.equal('Enable Auto Refresh') + expect(el[0].innerText.toLowerCase()).to.equal('enable auto refresh') }) cy.getByTestID('notification-success--children') .children() diff --git a/src/shared/components/DurationInput.tsx b/src/shared/components/DurationInput.tsx index 32663e824f..6713f06748 100644 --- a/src/shared/components/DurationInput.tsx +++ b/src/shared/components/DurationInput.tsx @@ -92,6 +92,11 @@ const DurationInput: FC = ({ status={inputStatus} onChange={e => onChange(e.target.value)} onFocus={() => setIsFocused(true)} + onKeyPress={e => { + if (e.key === 'Enter') { + setIsFocused(false) + } + }} testID={testID} /> From d5a6ca290252e020cf62a544f1b2a60af62a436a Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Thu, 2 Sep 2021 12:15:25 -0400 Subject: [PATCH 28/53] remove .only from test --- cypress/e2e/shared/dashboardsRefresh.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index 11fe97ece3..8f404a9722 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -160,7 +160,7 @@ describe('Dashboard refresh', () => { expect(el[0].innerText.toLowerCase()).to.equal('enable auto refresh') }) }) - it.only('can timeout on a preset inactivity timeout', done => { + it('can timeout on a preset inactivity timeout', done => { cy.getByTestID('enable-auto-refresh-button').click() cy.getByTestID('auto-refresh-input') .clear() From 5ef85cd80f6d33a427b0362b3663a55d62c1bcab Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Thu, 2 Sep 2021 09:58:54 -0700 Subject: [PATCH 29/53] fix: queryBuilder.test.ts and package.json fix remocal script --- cypress/e2e/shared/queryBuilder.test.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/shared/queryBuilder.test.ts b/cypress/e2e/shared/queryBuilder.test.ts index 7a7cb16cc0..70ba5b69ba 100644 --- a/cypress/e2e/shared/queryBuilder.test.ts +++ b/cypress/e2e/shared/queryBuilder.test.ts @@ -226,7 +226,7 @@ describe('The Query Builder', () => { cy.getByTestID('overlay') .contains('Name this Cell') .click() - cy.get('[placeholder="Name this Cell"]').type('A better name!') + cy.get('[placeholder="Name this Cell"]').type('A better name!{enter}') cy.get('.veo-contents').click() // click out of inline editor cy.getByTestID('save-cell--button').click() diff --git a/package.json b/package.json index f2f1990d4e..35dd38eb11 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "test:e2e:clean": "rm junit-results/*.xml", "test:e2e:all": "yarn test:e2e:clean && yarn test:e2e; yarn test:e2e:report;", "test:e2e:kind": "CYPRESS_dexUrl=http://dex-twodotoh.a.influxcloud.dev.local CYPRESS_baseUrl=https://twodotoh.a.influxcloud.dev.local CYPRESS_password=password cypress open --browser chrome --config chromeWebSecurity=false", - "test:e2e:remocal": "CYPRESS_dexUrl=https://dex-twodotoh-dev-${NS}.a.influxcloud.dev.local CYPRESS_baseUrl=https://twodotoh-dev-${NS}.a.influxcloud.dev.local CYPRESS_password=password cypress open --browser chrome --config chromeWebSecurity=false", + "test:e2e:remocal": "CYPRESS_dexUrl=https://dex-${NS}.a.influxcloud.dev.local CYPRESS_baseUrl=https://${NS}.a.influxcloud.dev.local CYPRESS_password=password cypress open --browser chrome --config chromeWebSecurity=false", "test:circleci": "yarn run test:ci --maxWorkers=2", "test:ci": "JEST_JUNIT_OUTPUT_DIR=\"./coverage\" jest --ci --coverage", "lint": "yarn tsc && yarn prettier && yarn eslint", From 1c3a63f5a94e18d75bcb686ff2e34d117224c173 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Thu, 2 Sep 2021 10:20:33 -0700 Subject: [PATCH 30/53] fix: queryBuilder.test.ts for firefox --- cypress/e2e/shared/queryBuilder.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/queryBuilder.test.ts b/cypress/e2e/shared/queryBuilder.test.ts index 70ba5b69ba..b2a47ced81 100644 --- a/cypress/e2e/shared/queryBuilder.test.ts +++ b/cypress/e2e/shared/queryBuilder.test.ts @@ -215,7 +215,7 @@ describe('The Query Builder', () => { }) // build query - cy.contains('mem').click('topLeft') // users sometimes click in random spots + cy.contains('mem').click('topLeft', {force: true}) // users sometimes click in random spots cy.contains('cached').click('bottomLeft') cy.contains('thrillbo-swaggins').click('left') cy.contains('sum').click() From 10f5f88ef12e7017eed51a2c370bd73cf865ca32 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Thu, 2 Sep 2021 16:05:20 -0400 Subject: [PATCH 31/53] chore: add html for to toggle label to make it functional and pass a test --- src/checkout/shared/FormToggle.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/checkout/shared/FormToggle.tsx b/src/checkout/shared/FormToggle.tsx index 054c2b5dcc..34b4e780c2 100644 --- a/src/checkout/shared/FormToggle.tsx +++ b/src/checkout/shared/FormToggle.tsx @@ -17,8 +17,11 @@ const FormToggle: FC = ({label, ...props}) => { checked={inputs.shouldNotify} onChange={() => handleSetInputs('shouldNotify', !inputs.shouldNotify)} testID={`${props.id}--checkbox`} + id={'shouldNotify--checkbox'} > - {label} + + {label} + ) } From d218c89d67b026b6292b250f0c97c8a3eab92ec4 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Thu, 2 Sep 2021 13:13:46 -0700 Subject: [PATCH 32/53] fix: lint --- src/checkout/shared/FormToggle.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkout/shared/FormToggle.tsx b/src/checkout/shared/FormToggle.tsx index 34b4e780c2..4f0a6f82cc 100644 --- a/src/checkout/shared/FormToggle.tsx +++ b/src/checkout/shared/FormToggle.tsx @@ -17,9 +17,9 @@ const FormToggle: FC = ({label, ...props}) => { checked={inputs.shouldNotify} onChange={() => handleSetInputs('shouldNotify', !inputs.shouldNotify)} testID={`${props.id}--checkbox`} - id={'shouldNotify--checkbox'} + id='shouldNotify--checkbox' > - + {label} From ff13d644db3a617c813610f47f3971d044314fef Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Thu, 2 Sep 2021 17:50:41 -0400 Subject: [PATCH 33/53] chore: fix test by getting the child element rather than clickiong on the parent div --- cypress/e2e/shared/variables.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/shared/variables.test.ts b/cypress/e2e/shared/variables.test.ts index 4cb5fab3e9..03c9c6acae 100644 --- a/cypress/e2e/shared/variables.test.ts +++ b/cypress/e2e/shared/variables.test.ts @@ -451,7 +451,7 @@ describe('Variables', () => { cy.get('button.inline-labels--add') .first() .clickAttached() - cy.getByTestID('inline-labels--popover--contents').type(firstLabelName) + cy.getByTestID('inline-labels--popover-field').type(firstLabelName) cy.getByTestID('inline-labels--create-new').click() cy.getByTestID('create-label-form--submit') .scrollIntoView() @@ -462,7 +462,7 @@ describe('Variables', () => { cy.get('button.inline-labels--add') .eq(1) .clickAttached() - cy.getByTestID('inline-labels--popover--contents').type(secondLabelName) + cy.getByTestID('inline-labels--popover-field').type(secondLabelName) cy.getByTestID('inline-labels--create-new').click() cy.getByTestID('create-label-form--submit') .scrollIntoView() @@ -473,7 +473,7 @@ describe('Variables', () => { cy.get('button.inline-labels--add') .last() .clickAttached() - cy.getByTestID('inline-labels--popover--contents').type(thirdLabelName) + cy.getByTestID('inline-labels--popover-field').type(thirdLabelName) cy.getByTestID('inline-labels--create-new').click() cy.getByTestID('create-label-form--submit') .scrollIntoView() From 9a1e4d3fb35b73dcdcda86bc192ec514cab0716d Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Thu, 2 Sep 2021 18:02:10 -0400 Subject: [PATCH 34/53] chore: fix prettier issue --- src/checkout/shared/FormToggle.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkout/shared/FormToggle.tsx b/src/checkout/shared/FormToggle.tsx index 4f0a6f82cc..34b4e780c2 100644 --- a/src/checkout/shared/FormToggle.tsx +++ b/src/checkout/shared/FormToggle.tsx @@ -17,9 +17,9 @@ const FormToggle: FC = ({label, ...props}) => { checked={inputs.shouldNotify} onChange={() => handleSetInputs('shouldNotify', !inputs.shouldNotify)} testID={`${props.id}--checkbox`} - id='shouldNotify--checkbox' + id={'shouldNotify--checkbox'} > - + {label} From f181026595730190995c3b7bd5177005872bffe8 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Fri, 3 Sep 2021 08:40:55 -0700 Subject: [PATCH 35/53] fix: lint issue --- src/checkout/shared/FormToggle.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkout/shared/FormToggle.tsx b/src/checkout/shared/FormToggle.tsx index 34b4e780c2..4f0a6f82cc 100644 --- a/src/checkout/shared/FormToggle.tsx +++ b/src/checkout/shared/FormToggle.tsx @@ -17,9 +17,9 @@ const FormToggle: FC = ({label, ...props}) => { checked={inputs.shouldNotify} onChange={() => handleSetInputs('shouldNotify', !inputs.shouldNotify)} testID={`${props.id}--checkbox`} - id={'shouldNotify--checkbox'} + id='shouldNotify--checkbox' > - + {label} From 7febe16301ef9a2f53022d30f219ace8a847cdf5 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Fri, 3 Sep 2021 08:44:31 -0700 Subject: [PATCH 36/53] fix: prettier --- src/checkout/shared/FormToggle.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/checkout/shared/FormToggle.tsx b/src/checkout/shared/FormToggle.tsx index 4f0a6f82cc..429ccc7b23 100644 --- a/src/checkout/shared/FormToggle.tsx +++ b/src/checkout/shared/FormToggle.tsx @@ -17,9 +17,9 @@ const FormToggle: FC = ({label, ...props}) => { checked={inputs.shouldNotify} onChange={() => handleSetInputs('shouldNotify', !inputs.shouldNotify)} testID={`${props.id}--checkbox`} - id='shouldNotify--checkbox' + id="shouldNotify--checkbox" > - + {label} From 30819dd845184051b3ecdb3b825e7319b4ca114c Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 11:49:11 -0400 Subject: [PATCH 37/53] changing how onboarding test checks button text --- cypress/e2e/oss/onboarding.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/oss/onboarding.test.ts b/cypress/e2e/oss/onboarding.test.ts index 76501b7813..ff4eb28561 100644 --- a/cypress/e2e/oss/onboarding.test.ts +++ b/cypress/e2e/oss/onboarding.test.ts @@ -71,16 +71,16 @@ describe('Onboarding', () => { cy.getByTestID('next').should('be.disabled') - cy.getByTestID('next') - .children('.cf-button--label') - .contains('Continue') + cy.getByTestID('next').then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // Input fields cy.fillInOSSLoginFormWithDefaults() - cy.getByTestID('next') - .children('.cf-button--label') - .contains('Continue') + cy.getByTestID('next').then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.getByTestID('next') .should('be.enabled') From 789eaa2e296672d64d7548a112a04b0ee9e172d6 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 12:14:40 -0400 Subject: [PATCH 38/53] chore: fixing the rest of onboarding test by changing how we check text in button --- cypress/e2e/oss/onboarding.test.ts | 65 ++++++++++++++++++------------ 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/cypress/e2e/oss/onboarding.test.ts b/cypress/e2e/oss/onboarding.test.ts index ff4eb28561..7deb950d0a 100644 --- a/cypress/e2e/oss/onboarding.test.ts +++ b/cypress/e2e/oss/onboarding.test.ts @@ -182,8 +182,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password').type(defaultPassword) @@ -191,8 +192,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.getByTestID('input-field--password-chk').type('drowssap') @@ -215,8 +217,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -226,8 +229,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -242,16 +246,18 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared username cy.getByTestID('input-field--username').clear() cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultUser').then((defaultUser: string) => { cy.getByTestID('input-field--username').type(defaultUser) @@ -259,8 +265,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared password cy.getByTestID('input-field--password').clear() @@ -272,8 +279,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -287,16 +295,18 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared org name cy.getByTestID('input-field--orgname').clear() cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -304,23 +314,26 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared bucket name cy.getByTestID('input-field--bucketname').clear() cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.getByTestID('input-field--bucketname').type(defaultBucket) }) cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) }) }) From 3ce23f7528ceaf8b32c3cc2f4f427219d754d33f Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 12:14:40 -0400 Subject: [PATCH 39/53] chore: fixing the rest of onboarding test by changing how we check text in button --- cypress/e2e/oss/onboarding.test.ts | 65 ++++++++++++++++++------------ 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/cypress/e2e/oss/onboarding.test.ts b/cypress/e2e/oss/onboarding.test.ts index ff4eb28561..7deb950d0a 100644 --- a/cypress/e2e/oss/onboarding.test.ts +++ b/cypress/e2e/oss/onboarding.test.ts @@ -182,8 +182,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password').type(defaultPassword) @@ -191,8 +192,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.getByTestID('input-field--password-chk').type('drowssap') @@ -215,8 +217,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -226,8 +229,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -242,16 +246,18 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared username cy.getByTestID('input-field--username').clear() cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultUser').then((defaultUser: string) => { cy.getByTestID('input-field--username').type(defaultUser) @@ -259,8 +265,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared password cy.getByTestID('input-field--password').clear() @@ -272,8 +279,9 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -287,16 +295,18 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared org name cy.getByTestID('input-field--orgname').clear() cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -304,23 +314,26 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) // check cleared bucket name cy.getByTestID('input-field--bucketname').clear() cy.getByTestID('next') .should('be.disabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) cy.getByTestID('input-field--bucketname').type(defaultBucket) }) cy.getByTestID('next') .should('be.enabled') - .children('.cf-button--label') - .contains('Continue') + .then(el => { + expect(el[0].innerText.toLowerCase()).to.equal('continue') + }) }) }) From ccbe4fa1422d77145d2a5cb208be64dd70333ece Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Fri, 3 Sep 2021 09:48:24 -0700 Subject: [PATCH 40/53] refactor: nav test variable name --- cypress/e2e/shared/nav.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/shared/nav.test.ts b/cypress/e2e/shared/nav.test.ts index 10728a50b7..4520f9916b 100644 --- a/cypress/e2e/shared/nav.test.ts +++ b/cypress/e2e/shared/nav.test.ts @@ -162,19 +162,19 @@ describe('navigation', () => { 'variables', 'templates', 'labels', - ].forEach(x => { - if (x === 'history') { + ].forEach(navItem => { + if (navItem === 'history') { cy.getByTestID('nav-item-alerting').click() - } else if (x === 'variables' || x === 'templates' || x === 'labels') { + } else if (navItem === 'variables' || navItem === 'templates' || navItem === 'labels') { cy.getByTestID('nav-item-settings').click() } else { cy.getByTestID('nav-item-load-data').click() } - cy.getByTestID(`nav-subitem-${x}`) + cy.getByTestID(`nav-subitem-${navItem}`) .last() .click() - cy.url().should('contain', x) + cy.url().should('contain', navItem) }) cy.get('.cf-tree-nav--toggle').click() From 8ffdc2cffec2895fe5b3410b0fec6ea76df28f0b Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Fri, 3 Sep 2021 09:51:26 -0700 Subject: [PATCH 41/53] refactor: DurationInput.tsx evt --- src/shared/components/DurationInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/components/DurationInput.tsx b/src/shared/components/DurationInput.tsx index 6713f06748..225dc80318 100644 --- a/src/shared/components/DurationInput.tsx +++ b/src/shared/components/DurationInput.tsx @@ -92,8 +92,8 @@ const DurationInput: FC = ({ status={inputStatus} onChange={e => onChange(e.target.value)} onFocus={() => setIsFocused(true)} - onKeyPress={e => { - if (e.key === 'Enter') { + onKeyPress={evt => { + if (evt.key === 'Enter') { setIsFocused(false) } }} From 6b8920285ffdb1524e6425ce8aae2afb4a072d75 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Fri, 3 Sep 2021 10:12:59 -0700 Subject: [PATCH 42/53] chore: prettier --- cypress/e2e/shared/nav.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/shared/nav.test.ts b/cypress/e2e/shared/nav.test.ts index 4520f9916b..832a710875 100644 --- a/cypress/e2e/shared/nav.test.ts +++ b/cypress/e2e/shared/nav.test.ts @@ -165,7 +165,11 @@ describe('navigation', () => { ].forEach(navItem => { if (navItem === 'history') { cy.getByTestID('nav-item-alerting').click() - } else if (navItem === 'variables' || navItem === 'templates' || navItem === 'labels') { + } else if ( + navItem === 'variables' || + navItem === 'templates' || + navItem === 'labels' + ) { cy.getByTestID('nav-item-settings').click() } else { cy.getByTestID('nav-item-load-data').click() From 1708760f060aee87e1219986e20edfce11294586 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 15:11:22 -0400 Subject: [PATCH 43/53] refactor: use cy.contains instead of selecting element in dom --- cypress/e2e/oss/onboarding.test.ts | 92 +++++++++++------------------- 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/cypress/e2e/oss/onboarding.test.ts b/cypress/e2e/oss/onboarding.test.ts index 7deb950d0a..201c42d436 100644 --- a/cypress/e2e/oss/onboarding.test.ts +++ b/cypress/e2e/oss/onboarding.test.ts @@ -78,9 +78,7 @@ describe('Onboarding', () => { // Input fields cy.fillInOSSLoginFormWithDefaults() - cy.getByTestID('next').then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.contains('CONTINUE') cy.getByTestID('next') .should('be.enabled') @@ -180,21 +178,17 @@ describe('Onboarding', () => { cy.getByTestID('input-field--username').type(defaultUser) }) - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password').type(defaultPassword) }) - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.getByTestID('input-field--password-chk').type('drowssap') @@ -215,11 +209,9 @@ describe('Onboarding', () => { // check password too short cy.getByTestID('form--element-error').should('contain.text', '8') - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -244,30 +236,24 @@ describe('Onboarding', () => { cy.getByTestID('input-error').should('not.exist') - cy.getByTestID('next') - .should('be.enabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.enabled') + + cy.contains('CONTINUE') // check cleared username cy.getByTestID('input-field--username').clear() - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.get('@defaultUser').then((defaultUser: string) => { cy.getByTestID('input-field--username').type(defaultUser) }) - cy.getByTestID('next') - .should('be.enabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.enabled') + + cy.contains('CONTINUE') // check cleared password cy.getByTestID('input-field--password').clear() @@ -277,11 +263,9 @@ describe('Onboarding', () => { 'Passwords do not match' ) - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -293,20 +277,16 @@ describe('Onboarding', () => { .type(defaultPassword) }) - cy.getByTestID('next') - .should('be.enabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.enabled') + + cy.contains('CONTINUE') // check cleared org name cy.getByTestID('input-field--orgname').clear() - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -321,19 +301,15 @@ describe('Onboarding', () => { // check cleared bucket name cy.getByTestID('input-field--bucketname').clear() - cy.getByTestID('next') - .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.disabled') + + cy.contains('CONTINUE') cy.getByTestID('input-field--bucketname').type(defaultBucket) }) - cy.getByTestID('next') - .should('be.enabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').should('be.enabled') + + cy.contains('CONTINUE') }) }) From 8e76c59849f99003d441404aaa4a664a2d4e95c0 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 17:10:56 -0400 Subject: [PATCH 44/53] refactor: use .contains instead of element manipulation for onboarding and dashboard refresh test --- cypress/e2e/oss/onboarding.test.ts | 80 +++++++++----------- cypress/e2e/shared/dashboardsRefresh.test.ts | 16 ++-- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/cypress/e2e/oss/onboarding.test.ts b/cypress/e2e/oss/onboarding.test.ts index 201c42d436..c2a316f430 100644 --- a/cypress/e2e/oss/onboarding.test.ts +++ b/cypress/e2e/oss/onboarding.test.ts @@ -71,14 +71,12 @@ describe('Onboarding', () => { cy.getByTestID('next').should('be.disabled') - cy.getByTestID('next').then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + cy.getByTestID('next').contains('CONTINUE', {matchCase: false}) // Input fields cy.fillInOSSLoginFormWithDefaults() - cy.contains('CONTINUE') + cy.getByTestID('next').contains('CONTINUE', {matchCase: false}) cy.getByTestID('next') .should('be.enabled') @@ -178,17 +176,17 @@ describe('Onboarding', () => { cy.getByTestID('input-field--username').type(defaultUser) }) - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password').type(defaultPassword) }) - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.getByTestID('input-field--password-chk').type('drowssap') @@ -209,9 +207,9 @@ describe('Onboarding', () => { // check password too short cy.getByTestID('form--element-error').should('contain.text', '8') - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -221,9 +219,7 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.disabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + .contains('CONTINUE', {matchCase: false}) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -236,24 +232,24 @@ describe('Onboarding', () => { cy.getByTestID('input-error').should('not.exist') - cy.getByTestID('next').should('be.enabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.enabled') + .contains('CONTINUE', {matchCase: false}) // check cleared username cy.getByTestID('input-field--username').clear() - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.get('@defaultUser').then((defaultUser: string) => { cy.getByTestID('input-field--username').type(defaultUser) }) - cy.getByTestID('next').should('be.enabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.enabled') + .contains('CONTINUE', {matchCase: false}) // check cleared password cy.getByTestID('input-field--password').clear() @@ -263,9 +259,9 @@ describe('Onboarding', () => { 'Passwords do not match' ) - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.get('@defaultPassword').then((defaultPassword: string) => { cy.getByTestID('input-field--password') @@ -277,16 +273,16 @@ describe('Onboarding', () => { .type(defaultPassword) }) - cy.getByTestID('next').should('be.enabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.enabled') + .contains('CONTINUE', {matchCase: false}) // check cleared org name cy.getByTestID('input-field--orgname').clear() - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.get('@defaultOrg').then((defaultOrg: string) => { cy.getByTestID('input-field--orgname').type(defaultOrg) @@ -294,22 +290,20 @@ describe('Onboarding', () => { cy.getByTestID('next') .should('be.enabled') - .then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('continue') - }) + .contains('CONTINUE', {matchCase: false}) // check cleared bucket name cy.getByTestID('input-field--bucketname').clear() - cy.getByTestID('next').should('be.disabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.disabled') + .contains('CONTINUE', {matchCase: false}) cy.getByTestID('input-field--bucketname').type(defaultBucket) }) - cy.getByTestID('next').should('be.enabled') - - cy.contains('CONTINUE') + cy.getByTestID('next') + .should('be.enabled') + .contains('CONTINUE', {matchCase: false}) }) }) diff --git a/cypress/e2e/shared/dashboardsRefresh.test.ts b/cypress/e2e/shared/dashboardsRefresh.test.ts index 8f404a9722..8a5c8ccb2d 100644 --- a/cypress/e2e/shared/dashboardsRefresh.test.ts +++ b/cypress/e2e/shared/dashboardsRefresh.test.ts @@ -156,11 +156,15 @@ describe('Dashboard refresh', () => { cy.visit(routeToReturnTo) cy.wait('@refreshQuery') cy.wait(5000) - cy.getByTestID('enable-auto-refresh-button').then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('enable auto refresh') - }) + cy.getByTestID( + 'enable-auto-refresh-button' + ).contains('ENABLE AUTO REFRESH', {matchCase: false}) }) it('can timeout on a preset inactivity timeout', done => { + cy.getByTestID( + 'enable-auto-refresh-button' + ).contains('ENABLE AUTO REFRESH', {matchCase: false}) + cy.getByTestID('enable-auto-refresh-button').click() cy.getByTestID('auto-refresh-input') .clear() @@ -190,9 +194,9 @@ describe('Dashboard refresh', () => { }) cy.wait(3100) - cy.getByTestID('enable-auto-refresh-button').then(el => { - expect(el[0].innerText.toLowerCase()).to.equal('enable auto refresh') - }) + cy.getByTestID( + 'enable-auto-refresh-button' + ).contains('ENABLE AUTO REFRESH', {matchCase: false}) cy.getByTestID('notification-success--children') .children() .should( From 2fba49d7d68b80659d45ca86acffcb1cdd1cbd2a Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 18:24:49 -0400 Subject: [PATCH 45/53] refactor: add custom command for clicking nav items --- cypress/e2e/shared/nav.test.ts | 24 ++++++++++++------------ cypress/index.d.ts | 2 ++ cypress/support/commands.ts | 7 +++++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/cypress/e2e/shared/nav.test.ts b/cypress/e2e/shared/nav.test.ts index 832a710875..41dbd42ed7 100644 --- a/cypress/e2e/shared/nav.test.ts +++ b/cypress/e2e/shared/nav.test.ts @@ -18,27 +18,27 @@ describe('navigation', () => { cy.getByTestID('load-data--header').should('exist') // Data Explorer Page - cy.getByTestID('nav-item-data-explorer').click({force: true}) + cy.clickNavBarItem('nav-item-data-explorer') cy.getByTestID('data-explorer--header').should('exist') // Dashboard Index Page - cy.getByTestID('nav-item-dashboards').click({force: true}) + cy.clickNavBarItem('nav-item-dashboards') cy.getByTestID('empty-dashboards-list').should('exist') // Tasks Index Page - cy.getByTestID('nav-item-tasks').click({force: true}) + cy.clickNavBarItem('nav-item-tasks') cy.getByTestID('tasks-page--header').should('exist') // Alerts Page - cy.getByTestID('nav-item-alerting').click({force: true}) + cy.clickNavBarItem('nav-item-alerting') cy.getByTestID('alerts-page--header').should('exist') // Settings Page - cy.getByTestID('nav-item-settings').click({force: true}) + cy.clickNavBarItem('nav-item-settings') cy.getByTestID('settings-page--header').should('exist') // Home Page - cy.getByTestID('tree-nav--header').click({force: true}) + cy.clickNavBarItem('tree-nav--header') cy.getByTestID('home-page--header').should('exist') // 404 @@ -103,7 +103,7 @@ describe('navigation', () => { }) it('can navigate in tabs of data page', () => { - cy.getByTestID('nav-item-load-data').click({force: true}) + cy.clickNavBarItem('nav-item-load-data') cy.getByTestID('tabs').within(() => { // buckets tab @@ -138,12 +138,12 @@ describe('navigation', () => { } it('can navigate in tabs of settings page', () => { - cy.getByTestID('nav-item-settings').click({force: true}) + cy.clickNavBarItem('nav-item-settings') exploreTabs(['templates', 'labels', 'variables']) }) it('can navigate in tabs of collapsed alerts page', () => { - cy.getByTestID('nav-item-alerting').click({force: true}) + cy.clickNavBarItem('nav-item-alerting') ;['checks', 'endpoints', 'rules'].forEach(tab => { cy.getByTestID(`alerting-tab--${tab}`).click() cy.getByTestID(`alerting-tab--${tab}--input`).should('to.be', 'checked') @@ -164,15 +164,15 @@ describe('navigation', () => { 'labels', ].forEach(navItem => { if (navItem === 'history') { - cy.getByTestID('nav-item-alerting').click() + cy.clickNavBarItem('nav-item-alerting') } else if ( navItem === 'variables' || navItem === 'templates' || navItem === 'labels' ) { - cy.getByTestID('nav-item-settings').click() + cy.clickNavBarItem('nav-item-settings') } else { - cy.getByTestID('nav-item-load-data').click() + cy.clickNavBarItem('nav-item-load-data') } cy.getByTestID(`nav-subitem-${navItem}`) diff --git a/cypress/index.d.ts b/cypress/index.d.ts index 096e1e8953..672bce9834 100644 --- a/cypress/index.d.ts +++ b/cypress/index.d.ts @@ -15,6 +15,7 @@ import { getByInputValue, getByTestIDAndSetInputValue, getByTitle, + clickNavBarItem, createTask, createMapVariable, createCSVVariable, @@ -56,6 +57,7 @@ declare global { signin: typeof signin setupUser: typeof setupUser clickAttached: typeof clickAttached + clickNavBarItem: typeof clickNavBarItem createSource: typeof createSource createCSVVariable: typeof createCSVVariable createQueryVariable: typeof createQueryVariable diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 3eb1998e76..e26a803448 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -297,6 +297,10 @@ export const upsertSecret = ( }) } +export const clickNavBarItem = (testID: string): Cypress.Chainable => { + return cy.getByTestID(testID).click({force: true}) +} + export const createTask = ( token: string, orgID?: string, @@ -971,6 +975,9 @@ Cypress.Commands.add( wrapEnvironmentVariablesForOss ) +// navigation bar +Cypress.Commands.add('clickNavBarItem', clickNavBarItem) + // dashboards Cypress.Commands.add('createDashboard', createDashboard) Cypress.Commands.add('createCell', createCell) From d42a3b6bd6c1926e27863fc8419cf8f11d51d319 Mon Sep 17 00:00:00 2001 From: Dong Kyun David Kim Date: Fri, 3 Sep 2021 18:30:29 -0400 Subject: [PATCH 46/53] refactor: use custom navbar click command --- cypress/e2e/shared/variables.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/shared/variables.test.ts b/cypress/e2e/shared/variables.test.ts index 03c9c6acae..dc27fb8ca4 100644 --- a/cypress/e2e/shared/variables.test.ts +++ b/cypress/e2e/shared/variables.test.ts @@ -17,8 +17,8 @@ describe('Variables', () => { it('can CRUD a CSV, upload, map, and query variable and search for variables based on names', () => { // Navigate away from and back to variables index using the nav bar - cy.getByTestID('nav-item-dashboards').click() - cy.getByTestID('nav-item-settings').click({force: true}) + cy.clickNavBarItem('nav-item-dashboards') + cy.clickNavBarItem('nav-item-settings') cy.getByTestID('templates--tab').click() cy.getByTestID('variables--tab').click() From 8c8c9f23d3313078be5f408a26ef96f504a704ea Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Sat, 4 Sep 2021 10:48:31 -0700 Subject: [PATCH 47/53] chore: add comment --- cypress/support/commands.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index e26a803448..7db4d1691e 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -297,6 +297,7 @@ export const upsertSecret = ( }) } +// TODO: (sahas) need to make this function to actually mimic the navbar functionality export const clickNavBarItem = (testID: string): Cypress.Chainable => { return cy.getByTestID(testID).click({force: true}) } From a877f6fc80472873c24644abda9169acae51663e Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Sat, 4 Sep 2021 10:50:47 -0700 Subject: [PATCH 48/53] chore: move line above comment --- cypress/e2e/shared/explorer.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/explorer.test.ts b/cypress/e2e/shared/explorer.test.ts index e70b92f886..4c9953049f 100644 --- a/cypress/e2e/shared/explorer.test.ts +++ b/cypress/e2e/shared/explorer.test.ts @@ -64,9 +64,9 @@ describe('DataExplorer', () => { }) cy.contains('Submit').click() cy.get('.cf-tree-nav--toggle').click() + cy.getByTestID('nav-item-load-data').click() // Can't use the testID to select this nav item because Clockface is silly and uses the same testID twice // Issue: https://github.com/influxdata/clockface/issues/539 - cy.getByTestID('nav-item-load-data').click() cy.get('.cf-tree-nav--sub-item-label') .contains('Buckets') .click() From 3da5ca82e68aee19684181dcae9429727d6639df Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Sat, 4 Sep 2021 10:51:26 -0700 Subject: [PATCH 49/53] fix: try flows test --- cypress/e2e/shared/flows.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/shared/flows.test.ts b/cypress/e2e/shared/flows.test.ts index 6bf8e4c573..77acbdd904 100644 --- a/cypress/e2e/shared/flows.test.ts +++ b/cypress/e2e/shared/flows.test.ts @@ -369,6 +369,6 @@ describe('Flows', () => { cy.getByTestID('resource-editable-name').click() // visualizations should exist - cy.getByTestID('giraffe-inner-plot').should('exist') + cy.getByTestID('giraffe-inner-plot').scrollIntoView().should('be.visible') }) }) From 090f8d45ff3e1a8c2ca8544508a89a007cff1a6e Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Sat, 4 Sep 2021 10:53:49 -0700 Subject: [PATCH 50/53] chore: prettier --- cypress/e2e/shared/flows.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/shared/flows.test.ts b/cypress/e2e/shared/flows.test.ts index 77acbdd904..ca3584c208 100644 --- a/cypress/e2e/shared/flows.test.ts +++ b/cypress/e2e/shared/flows.test.ts @@ -369,6 +369,8 @@ describe('Flows', () => { cy.getByTestID('resource-editable-name').click() // visualizations should exist - cy.getByTestID('giraffe-inner-plot').scrollIntoView().should('be.visible') + cy.getByTestID('giraffe-inner-plot') + .scrollIntoView() + .should('be.visible') }) }) From 3fcf9b4ec9a3981456e25b8395ebf251f33c1464 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Sat, 4 Sep 2021 11:00:00 -0700 Subject: [PATCH 51/53] fix: try a viewport size globally --- cypress.json | 4 +++- cypress/e2e/shared/explorerVisualizations.test.ts | 2 -- cypress/e2e/shared/simpleTable.test.ts | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cypress.json b/cypress.json index f67f39bda2..21eaf39127 100644 --- a/cypress.json +++ b/cypress.json @@ -12,5 +12,7 @@ "www.google-analytics.com", "www.googletagmanager.com", "www.honeybadger.io" - ] + ], + "viewportWidth": 1200, + "viewportHeight": 1000 } diff --git a/cypress/e2e/shared/explorerVisualizations.test.ts b/cypress/e2e/shared/explorerVisualizations.test.ts index a5dab78c78..147ccbd4be 100644 --- a/cypress/e2e/shared/explorerVisualizations.test.ts +++ b/cypress/e2e/shared/explorerVisualizations.test.ts @@ -415,8 +415,6 @@ describe('visualizations', () => { }) it('can view table data & scroll to bottom', () => { - // to fit all the elements in screen we force a view port size - cy.viewport(1200, 1000) // build the query to return data from beforeEach cy.getByTestID(`selector-list m`).click() cy.getByTestID('selector-list v').click() diff --git a/cypress/e2e/shared/simpleTable.test.ts b/cypress/e2e/shared/simpleTable.test.ts index ccb5702cef..548222333c 100644 --- a/cypress/e2e/shared/simpleTable.test.ts +++ b/cypress/e2e/shared/simpleTable.test.ts @@ -6,8 +6,6 @@ describe('simple table interactions', () => { const simpleLarge = 'simple-large' const simpleOverflow = 'simple-overflow' beforeEach(() => { - // to fit all the elements in screen we force a view port size - cy.viewport(1200, 1000) cy.flush() cy.signin().then(() => { cy.get('@org').then(({id: orgID}: Organization) => { From 4ef45c6628bb159fedd32da431563d4b596dc8b4 Mon Sep 17 00:00:00 2001 From: Chitlange Sahas Date: Tue, 7 Sep 2021 09:20:20 -0700 Subject: [PATCH 52/53] fix: add new line to annotationSetup --- cypress/e2e/util/annotationsSetup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/util/annotationsSetup.ts b/cypress/e2e/util/annotationsSetup.ts index a10e91a684..3b73d4d6ab 100644 --- a/cypress/e2e/util/annotationsSetup.ts +++ b/cypress/e2e/util/annotationsSetup.ts @@ -277,4 +277,4 @@ export const testDeleteAnnotation = (cy: Cypress.Chainable) => { addAnnotation(cy) deleteAnnotation(cy) -} \ No newline at end of file +} From 481649cd885a7ba53193c5721f4c24d4c098d265 Mon Sep 17 00:00:00 2001 From: ChitlangeSahas Date: Tue, 7 Sep 2021 10:52:44 -0700 Subject: [PATCH 53/53] fix: rename customFocus to disableAutoFocus --- package.json | 2 +- src/variables/components/TypeAheadVariableDropdown.tsx | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3d02a2cf2e..2f8364ab8d 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ }, "dependencies": { "@docsearch/react": "^3.0.0-alpha.37", - "@influxdata/clockface": "^3.0.0-beta.6", + "@influxdata/clockface": "^3.0.0-beta.7", "@influxdata/flux": "^0.5.1", "@influxdata/flux-lsp-browser": "^0.5.53", "@influxdata/giraffe": "^2.18.0", diff --git a/src/variables/components/TypeAheadVariableDropdown.tsx b/src/variables/components/TypeAheadVariableDropdown.tsx index d2e965b73f..09d180529e 100644 --- a/src/variables/components/TypeAheadVariableDropdown.tsx +++ b/src/variables/components/TypeAheadVariableDropdown.tsx @@ -284,7 +284,7 @@ class TypeAheadVariableDropdown extends PureComponent { testID={this.props.testID || `variable-dropdown--${name}`} onClickAway={this.onClickAwayHere} menuOpen={menuOpen} - customFocus + disableAutoFocus button={(active, onClick) => (