Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress tests and e2e pipeline #5896

Merged
merged 69 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e063567
test: welcome test, dashboard test, explore browser test
Iszy-Ami Sep 20, 2021
2720ab7
test: snapshot testing
Iszy-Ami Sep 20, 2021
e13e100
feat: adding testing snapshots
Iszy-Ami Sep 20, 2021
dc1cb84
chore: update unmet peer dependency
Iszy-Ami Sep 21, 2021
5abff55
fix: name of dropdown toggle
Iszy-Ami Sep 21, 2021
6b381c6
test: connecting to influxdb
Iszy-Ami Sep 27, 2021
4b4896d
fix: remove unnecessary influxdb-onboarding.sh script.
Iszy-Ami Sep 30, 2021
6ec5cee
chore: updated go 1.17.1 for cypress tests
rhajek Sep 29, 2021
814738d
refactor: remove unnecessary influxdb-onboarding command from Makefile
Iszy-Ami Sep 30, 2021
fa9abb5
refactor: remove unnecessary influxdb-onboarding command from circlec…
Iszy-Ami Sep 30, 2021
4ee37b4
test: initialising database by using environment properties (in Makef…
Iszy-Ami Sep 30, 2021
e0d51d5
chore: fixing cypress tests
rhajek Oct 1, 2021
2f38b1b
test: deleting connection to influxd1
Iszy-Ami Oct 1, 2021
be41f96
tests: optimize build, reuse workspace
rhajek Oct 1, 2021
88cd2cc
tests: optimize build
rhajek Oct 1, 2021
77b308b
test: remove unused code
Iszy-Ami Oct 26, 2021
2566191
fix: remove unuse dashboard
Iszy-Ami Nov 4, 2021
944af8f
chore(e2e-pipeline): add pipeline for chrono cypress tests
tomklapka Feb 11, 2022
e64521e
chore: run action on push
tomklapka Feb 16, 2022
3de07f1
chore: fix e2e pipeline
tomklapka Feb 16, 2022
e0480e9
chore: add yarn install
tomklapka Feb 16, 2022
6b107f9
chore: add log upload
tomklapka Feb 17, 2022
97db4c0
chore: show logs to see what is going on with chronograf
tomklapka Feb 17, 2022
77bb906
chore: fix log cats
tomklapka Feb 17, 2022
08723f2
chore: add sleep
tomklapka Feb 17, 2022
958964b
fix: chronograf run command
tomklapka Feb 17, 2022
9388a01
chore(ui): regenerate yarn.lock after rebase
sranka Feb 22, 2022
87d3bb6
test: welcome test, dashboard test, explore browser test
Iszy-Ami Sep 20, 2021
fc63a23
test: snapshot testing
Iszy-Ami Sep 20, 2021
246ef56
feat: adding testing snapshots
Iszy-Ami Sep 20, 2021
8d12a87
chore(e2e): local script for influxdb enterprise deployment
tomklapka Feb 23, 2022
d97e0ba
chore(e2e): update cert-manager in actions pipeline
tomklapka Feb 23, 2022
8cadb84
chore: fix coredns issue
tomklapka Feb 23, 2022
700c4a5
chore: fix certmanager deployment
tomklapka Feb 23, 2022
d9ae4d7
test: welcome test, dashboard test, explore browser test
Iszy-Ami Sep 20, 2021
df57577
test: snapshot testing
Iszy-Ami Sep 20, 2021
b490f8a
feat: adding testing snapshots
Iszy-Ami Sep 20, 2021
e361d5f
chore: update unmet peer dependency
Iszy-Ami Sep 21, 2021
d051291
test(cypress): add cypress env, and commands
k3yi0 Feb 21, 2022
39e7528
test(cypress): add basic InfluxDB setup connection test
k3yi0 Feb 21, 2022
ab5fb55
fix: temporary commented out the file as it uses non existing functions
k3yi0 Feb 21, 2022
4ae5438
test(cypress): add dashboard create, rename and delelete test
k3yi0 Feb 21, 2022
fcb4e32
test(cypress): add routes
k3yi0 Feb 21, 2022
1e557ba
chore: regenerate yarn.lock
sranka Feb 22, 2022
b954adb
chore: remove unused file
sranka Feb 22, 2022
b42a76d
chore: comment out code
k3yi0 Feb 23, 2022
4cac946
chore: comment out code
k3yi0 Feb 23, 2022
6b1d937
fix: remove calling non-existent function
k3yi0 Feb 24, 2022
f10bfde
fix: createConnection uses unsafe SSL
k3yi0 Feb 24, 2022
d65dc35
turns on flux
k3yi0 Mar 3, 2022
b0f309e
test(cypress): rewritten Query Builder tests using _internal.monitor
k3yi0 Mar 2, 2022
9034c6d
chore: yarn prettier
k3yi0 Mar 2, 2022
c35a0ce
fix: add missing custom window period
k3yi0 Mar 2, 2022
334cab5
fix: remove it.only
k3yi0 Mar 2, 2022
7a3da41
Add flux-enable to a workflow file
k3yi0 Mar 4, 2022
ad1329e
fix: github actions workflow file flux-enabled
k3yi0 Mar 4, 2022
554aa60
fix: force restart by deleing pod
k3yi0 Mar 4, 2022
f00daab
fix: restart a container to apply a new configmap
k3yi0 Mar 4, 2022
78f585b
fix: restart container
k3yi0 Mar 4, 2022
e422025
chore: flux-enabled is now true by default
k3yi0 Mar 17, 2022
1d6ec92
fix: selecting correct elements
k3yi0 Mar 17, 2022
334401f
chore: update e2e pipeline
tomklapka Mar 21, 2022
317ddbb
chore: add scheduled action run once a working day
tomklapka Mar 21, 2022
2b9043e
chore: remove commented code
k3yi0 Mar 22, 2022
c662f2c
chore: change file extenction to .ts and adjust code accordingly
k3yi0 Mar 23, 2022
e5b311b
chore: pipeline fixes
tomklapka Mar 23, 2022
814fc0b
chore: clean up e2e:influxdb2 references
tomklapka Mar 23, 2022
bd21764
fix: yarn installation, no risky changes in make clean
tomklapka Mar 24, 2022
f023b06
chore: update changelog
sranka Mar 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(cypress): rewritten Query Builder tests using _internal.monitor
  • Loading branch information
k3yi0 authored and sranka committed Mar 25, 2022
commit b0f309e5238e84bd882e14d6cd24a6417adfb3b1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ yarn-error.log
ui/.vs/slnx.sqlite
out.log
ui/cypress/kube-config
ui/cypress/.local-chronograf-influxdb-enterprise.sh.swp
196 changes: 196 additions & 0 deletions ui/cypress/integration/queryBuilder.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
describe('query builder', () => {
beforeEach(() => {
cy.deleteDashboards()
cy.cutConnections()
cy.createConnection()
cy.createDashboard()

cy.get('@connections').then(connections => {
cy.get('@dashboards').then(dashboards => {
cy.fixture('routes').then(routes => {
cy.visit(
`/sources/${connections[0].id}${routes.dashboards}/${dashboards[0].id}`
)
})
})
})

cy.get('#Line').click()
cy.get('.dash-graph').contains('Add Data').click()
cy.get('.source-selector').within(() => {
cy.get('@connections').then(connections => {
cy.get('.dropdown--selected').should('have.text', 'Dynamic Source')
cy.get('.dropdown--button').click()
cy.get('.dropdown--menu').contains(connections[0].name).click()
cy.get('.dropdown--selected').should('have.text', connections[0].name)
})

cy.get('button').contains('Flux').click().should('have.class', 'active')
})

cy.get('button').contains('Query Builder').click()
})

it('create a query, change its aggregation function and fill missing values', () => {
let clusterID: string
let queryTemplate: string

cy.get('[data-testid="bucket-selector"]').within(() => {
cy.get('.flux-query-builder--list-item').contains('internal').click()
})

cy.get('[data-testid="builder-card"]')
.eq(0)
.within(() => {
cy.get('#flxts0_database').should('exist').click({force: true})
})

cy.get('[data-testid="builder-card"]')
.eq(1)
.within(() => {
cy.get('.flux-query-builder--list-item')
.should('exist')
.click({force: true})
.then(value => {
clusterID = value.text()
})
})

const checkQuery = (queryTemplate: string): void => {
cy.get('.flux-query-builder--actions')
.contains('Query Editor')
.click({force: true})
cy.get('.flux-script-wizard--bg-hint')
.should('not.exist')
.then(() => {
cy.get('.CodeMirror-line').then(lines =>
expect(lines.text()).to.be.equal(queryTemplate)
)
})

cy.get('button').contains('Query Builder').click({force: true})
}

cy.get('.flux-query-builder--actions')
.contains('Submit')
.click()
.then(() => {
queryTemplate =
'from(bucket: "_internal/monitor")' +
' |> range(start: v.timeRangeStart, stop: v.timeRangeStop)' +
' |> filter(fn: (r) => r["_measurement"] == "database")' +
` |> filter(fn: (r) => r["clusterID"] == "${clusterID}")` +
' |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)' +
' |> yield(name: "mean")'

checkQuery(queryTemplate)
})

cy.get('[data-testid="aggregation-selector"]').within(() => {
cy.get('[data-testid="builder-card--body"]').within(() => {
cy.get('.slide-toggle').click().should('have.class', 'active')
})

cy.get('.builder-card--contents').within(() => {
cy.get('#flx-agrselectmean').click()

// Temporarily jump outside the builder-card--body element scope to check whether or not notification error message popped up
cy.document()
.its('body')
.within(() => {
cy.get('.notification-error')
.should('exist')
.and(
'have.text',
'You must have at least one aggregation function selected'
)
})

cy.get('#flx-agrselectmax').click()
cy.get('#flx-agrselectmean').click()
})
})

cy.get('[data-testid="builder-card"]')
.eq(2)
.should('contain.text', 'Filter')
.within(() => {
cy.get('.dropdown-selected').contains('Filter').click()
cy.get('.dropdown-item').contains('Group').click()
cy.get('.dropdown-selected').should('contain.text', 'Group')
cy.get('.flux-query-builder--list-item')
.contains('time')
.click({force: true})
})

cy.get('.flux-query-builder--actions')
.contains('Submit')
.click()
.then(() => {
queryTemplate =
'from(bucket: "_internal/monitor")' +
' |> range(start: v.timeRangeStart, stop: v.timeRangeStop)' +
' |> filter(fn: (r) => r["_measurement"] == "database")' +
` |> filter(fn: (r) => r["clusterID"] == "${clusterID}")` +
' |> group(columns: ["_time"])' +
' |> aggregateWindow(every: v.windowPeriod, fn: max, createEmpty: true)' +
' |> yield(name: "max")'

checkQuery(queryTemplate)
})
})

it('use filters to search for tags, activate them and keep track of the selected tags counter', () => {
cy.get('[data-testid="bucket-selector"]').within(() => {
cy.get('.flux-query-builder--list-item').should('have.length', 1)
cy.get('[data-testid="builder-card--menu"]').type('Hello World')
cy.get('.flux-query-builder--list-item').should('not.exist')
cy.get('[data-testid="builder-card--menu"]').clear()
cy.get('.flux-query-builder--list-item')
.should('have.length', 1)
.and('contain.text', 'internal')
})

cy.get('[data-testid="builder-card"]').within(() => {
cy.get('.flux-tag-selector--count').should('not.exist')
cy.get('.flux-query-builder--list-item')
.contains('database')
.click({force: true})
cy.get('.flux-tag-selector--count').should('have.text', 1)
cy.get('.flux-query-builder--list-item')
.contains('cluster')
.click({force: true})
cy.get('.flux-tag-selector--count').should('have.text', 2)
cy.get('.flux-query-builder--list-item')
.contains('database')
.click({force: true})
cy.get('.flux-tag-selector--count').should('have.text', 1)
cy.get('.flux-query-builder--list-item')
.contains('cluster')
.click({force: true})
cy.get('.flux-tag-selector--count').should('not.exist')
})
})

it('add and remove building card', () => {
cy.get('.builder-card--list').within(() => {
cy.get('.builder-card').should('have.length', 2)
cy.get('.flux-query-builder--add-card-button').click()
cy.get('.flux-query-builder--add-card-button').click()

cy.get('.builder-card')
.should('have.length', 4)
.eq(3)
.within(() => {
cy.get('.builder-card--delete').click({force: true})
})
cy.get('.builder-card')
.should('have.length', 3)
.eq(2)
.within(() => {
cy.get('.builder-card--delete').click({force: true})
})
cy.get('.builder-card').should('have.length', 2)
})
})
})