ui: e2e tests, improved cypress test for tsx, overview and db page#63401
ui: e2e tests, improved cypress test for tsx, overview and db page#63401craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
dhartunian
left a comment
There was a problem hiding this comment.
Great start!
Reviewed 1 of 2 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @nanduu04)
pkg/ui/cypress/integration/databases/databases.visual.spec.ts, line 16 at r1 (raw file):
cy.findAllByText("Databases").should("exist"); cy.findAllByText("defaultdb").should("exist"); cy.findAllByText("postgres").should("exist");
Seems odd to check for the postgres database in a CRDB test 😄
pkg/ui/cypress/integration/databases/databases.visual.spec.ts, line 23 at r1 (raw file):
it("renders the view for databases/tables view", () => { cy.visit("#/databases/tables"); cy.exec('cockroach sql --insecure --execute="create table test (id int)";');
I recommend using create table if not exists so that this test can be run multiple times on the same DB, or execute a drop operation at the end of the test.
pkg/ui/cypress/integration/databases/databases.visual.spec.ts, line 34 at r1 (raw file):
cy.findAllByText("public.test").should("exist"); cy.findAllByText("public.test1").should("exist"); cy.findAllByText("public.test2").should("exist");
Can you add a test for loading table stats as well? This is the button you can click to see detailed statistics on individual db tables. It loads data asynchronously.
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 18 at r1 (raw file):
}); describe("Transactions - Check check whether the transactions have been exectuted properly", () => {
nit: The naming on this test should be more specific. We're testing that transaction statistics show up properly, not that the transaction executes.
sp: executed
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 24 at r1 (raw file):
'cockroach sql --insecure --execute="BEGIN; CREATE TABLE cypress_test (id int); INSERT INTO cypress_test VALUES (234); INSERT INTO cypress_test VALUES (234); SELECT * FROM cypress_test; COMMIT;"' ); cy.findAllByPlaceholderText("Search transactions")
Do you need findAll here if you're targeting a single element? Would findByPlaceholderText work?
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 26 at r1 (raw file):
cy.findAllByPlaceholderText("Search transactions") .should("exist") .click()
Do you need to click in order to type in the field?
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 28 at r1 (raw file):
.click() .type("CREATE TABLE cypress_test"); cy.findAllByRole("button", "Enter").eq(0).click();
There should only be a single "Enter" button on the page. Can we do it without findAll and without eq(0)?
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 36 at r1 (raw file):
cy.findAllByText("CREATE TABLE cypress_test").should("exist"); cy.findAllByText("INSERT INTO cypress_test").should("exist"); cy.findAllByText("SELECT FROM cypress_test").should("exist");
Can you add a test that clicks on the Transaction into the Transaction details page and verifies that each statement fingerprint within the transaction shows up individually as well.
2611f87 to
86002fe
Compare
nanduu04
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @nanduu04)
pkg/ui/cypress/integration/databases/databases.visual.spec.ts, line 16 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
Seems odd to check for the
postgresdatabase in a CRDB test 😄
Removed
pkg/ui/cypress/integration/databases/databases.visual.spec.ts, line 23 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
I recommend using
create table if not existsso that this test can be run multiple times on the same DB, or execute adropoperation at the end of the test.
Done
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 18 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
nit: The naming on this test should be more specific. We're testing that transaction statistics show up properly, not that the transaction executes.
sp: executed
Done
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 24 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
Do you need
findAllhere if you're targeting a single element? WouldfindByPlaceholderTextwork?
Removed
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 26 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
Do you need to click in order to type in the field?
Yep, we need to click to type
pkg/ui/cypress/integration/transactions/transactions.visual.spec.ts, line 28 at r1 (raw file):
Previously, dhartunian (David Hartunian) wrote…
There should only be a single "Enter" button on the page. Can we do it without
findAlland withouteq(0)?
removed
86002fe to
0195d7e
Compare
dhartunian
left a comment
There was a problem hiding this comment.
ui: e2e tests, improved cypress test for transactions, overview and database page
this line is too long. truncate to "ui: e2e tests for txns, overview, db pages" or something like that.
otherwise, feel free to merge after fixing the commit message title (make sure to update it to match the PR title as well)
Reviewed 3 of 3 files at r2.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @nanduu04)
Previously, only visual regression tests were written Wrote cypress tests using the cypress-testing-library Release note: None
0195d7e to
57e2a22
Compare
|
bors r+ |
|
Build succeeded: |
Previously, only visual regression tests were written
Wrote cypress tests using the cypress-testing-library
CRDB-2388
Release note: None