-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cypress e2e testing for shareable link
- Loading branch information
1 parent
65b5c30
commit 104f571
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe("Substrait Fiddle Shareable Link test", () => { | ||
beforeEach(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("shareable link", () => { | ||
cy.get("select").select("sql"); | ||
|
||
cy.get("#status").should("have.text", "// Status\n"); | ||
|
||
cy.get("#editor") | ||
.click() | ||
.focused() | ||
.type("{ctrl}a") | ||
.clear() | ||
.type("select * from lineitem;"); | ||
|
||
cy.get(".multiselect__tags").click(); | ||
cy.contains(".multiselect__option", "2001") | ||
.click() | ||
|
||
cy.get("button").contains("Generate").click(); | ||
|
||
cy.get("button").contains("Copy Link").click(); | ||
|
||
cy.window().then((window) => { | ||
const link = window.navigator.clipboard.readText(); | ||
return link; | ||
}).then((link) => { | ||
cy.visit(link); | ||
cy.get("#editor").should("not.be.empty") | ||
cy.contains(".multiselect__tag", "1002").should("exist"); | ||
cy.contains(".multiselect__tag", "2001").should("exist"); | ||
}); | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters