-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
test: add e2e tests for pages under tools dropdown #4533
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
Changes from 4 commits
0c6bcdd
cfacd6e
504f7f3
a41b39e
88e545d
a9c6212
2118a1a
ada737a
9df361d
b1a9aff
4fb2c32
09f8016
626a99a
acbdb6b
d81fa0a
a3fb69a
38cb603
844ff45
b689fe3
a36ba19
88335e4
5134008
4044946
0083202
bd8f6e1
ac3e698
1e3e949
c0baccf
d8fc389
c52db52
d6a5e32
d106460
7447d5d
6f0a445
bdfbcf6
95aedb9
1c4b835
e181b2d
82a8927
99cea89
3cf172a
22b6a55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| class ToolsGeneratorPage { | ||
| visit() { | ||
| cy.visit('/tools/generator'); | ||
| } | ||
|
|
||
| verifyHeadingExists(text) { | ||
|
||
| cy.contains('h1, h2, h3, h4, h5, h6', text).should('be.visible'); | ||
| } | ||
|
|
||
| verifyHeader() { | ||
| this.verifyHeadingExists('Docs, Code, Anything!'); | ||
| } | ||
|
|
||
anushkaaaaaaaa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| verifyMainImage() { | ||
| cy.get('img[alt="generator diagram"]').should('be.visible'); | ||
| } | ||
|
||
|
|
||
| verifyGithubLink() { | ||
| cy.contains('a', 'View on Github') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', 'https://www.github.com/asyncapi/generator'); | ||
| } | ||
|
|
||
anushkaaaaaaaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| verifyDocsLink() { | ||
| cy.contains('a', 'View Docs') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', '/docs/tools/generator'); | ||
| } | ||
| } | ||
|
|
||
| export default ToolsGeneratorPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| class ToolsMiscPage { | ||
| visitCli() { | ||
| cy.visit('/tools/cli'); | ||
| } | ||
|
|
||
| visitParsers() { | ||
| cy.visit('/tools/parsers'); | ||
| } | ||
|
|
||
| visitGithubActions() { | ||
| cy.visit('/tools/github-actions'); | ||
|
||
| } | ||
|
|
||
| verifyHeadingExists(text) { | ||
| cy.contains('h1, h2, h3, h4, h5, h6', text).should('be.visible'); | ||
|
||
| } | ||
|
|
||
| // CLI page checks | ||
| verifyCliHeader() { | ||
| this.verifyHeadingExists( | ||
| 'Interact with AsyncAPI from the comfort of your CLI', | ||
| ); | ||
| } | ||
|
|
||
| verifyCliGithubLink() { | ||
| cy.contains('a', 'View on Github') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', 'https://www.github.com/asyncapi/cli'); | ||
| } | ||
|
|
||
| verifyCliDocsLink() { | ||
| cy.contains('a', 'View Docs') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', '/docs/tools/cli'); | ||
| } | ||
|
||
|
|
||
| verifyCliInstallSnippet() { | ||
| cy.contains('code', 'npm install -g @asyncapi/cli').should('exist'); | ||
| } | ||
|
|
||
| // Parsers page checks | ||
| verifyParsersHeader() { | ||
| this.verifyHeadingExists('Build your own tools'); | ||
| } | ||
|
|
||
| verifyParsersGithubLink() { | ||
| cy.contains('a', 'View on Github') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', 'https://www.github.com/asyncapi/parser-js'); | ||
| } | ||
|
|
||
| verifyParsersInstallSnippet() { | ||
| cy.contains('code', 'npm install @asyncapi/parser').should('exist'); | ||
| } | ||
|
|
||
| // GitHub Actions page checks | ||
| verifyGhActionsHeader() { | ||
| this.verifyHeadingExists('Automate using GitHub Actions'); | ||
| } | ||
|
|
||
| verifyGhActionsGithubLink() { | ||
| cy.contains('a', 'View on Github') | ||
| .should('be.visible') | ||
| .and( | ||
| 'have.attr', | ||
| 'href', | ||
| 'https://www.github.com/asyncapi/github-action-for-generator', | ||
| ); | ||
| } | ||
|
||
| } | ||
|
|
||
| export default ToolsMiscPage; | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| class ToolsModelinaPage { | ||
| visit() { | ||
| cy.visit('/tools/modelina'); | ||
| } | ||
|
|
||
| verifyHeadingExists(text) { | ||
| cy.contains('h1, h2, h3, h4, h5, h6', text).should('be.visible'); | ||
| } | ||
|
|
||
| verifyHeader() { | ||
| this.verifyHeadingExists('Modelina'); | ||
| } | ||
|
|
||
| verifyGithubLink() { | ||
| cy.contains('a', 'View on Github') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', 'https://www.github.com/asyncapi/modelina'); | ||
| } | ||
|
|
||
| verifyTryItNowLink() { | ||
| cy.contains('a', 'Try it now') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', 'https://modelina.org/playground'); | ||
| } | ||
|
|
||
| verifyInstallSnippet() { | ||
|
||
| cy.contains('code', 'npm install @asyncapi/modelina').should('exist'); | ||
| } | ||
| } | ||
|
|
||
| export default ToolsModelinaPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import ToolsGeneratorPage from './pages/toolsGenerator'; | ||
|
|
||
| describe('Tools - Generator Page', () => { | ||
| const page = new ToolsGeneratorPage(); | ||
|
|
||
| beforeEach(() => { | ||
| page.visit(); | ||
| }); | ||
|
|
||
| it('User sees the main header', () => { | ||
| page.verifyHeader(); | ||
| }); | ||
|
|
||
| it('User sees the generator diagram image', () => { | ||
| page.verifyMainImage(); | ||
| }); | ||
|
|
||
| it('User verifies GitHub button link', () => { | ||
| page.verifyGithubLink(); | ||
| }); | ||
|
|
||
| it('User verifies Docs button link', () => { | ||
| page.verifyDocsLink(); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import ToolsMiscPage from './pages/toolsMisc'; | ||
|
|
||
| describe('Tools - CLI / Parsers / GitHub Actions', () => { | ||
anushkaaaaaaaa marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const page = new ToolsMiscPage(); | ||
|
|
||
| describe('CLI', () => { | ||
| beforeEach(() => { | ||
| page.visitCli(); | ||
| }); | ||
|
|
||
| it('User sees the CLI header', () => { | ||
| page.verifyCliHeader(); | ||
| }); | ||
|
|
||
| it('User verifies CLI GitHub and Docs links', () => { | ||
| page.verifyCliGithubLink(); | ||
| page.verifyCliDocsLink(); | ||
| }); | ||
|
|
||
| it('User sees CLI install snippet', () => { | ||
| page.verifyCliInstallSnippet(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Parsers', () => { | ||
| beforeEach(() => { | ||
| page.visitParsers(); | ||
| }); | ||
|
|
||
| it('User sees the Parsers header', () => { | ||
| page.verifyParsersHeader(); | ||
| }); | ||
|
|
||
| it('User verifies Parsers GitHub link', () => { | ||
| page.verifyParsersGithubLink(); | ||
| }); | ||
|
|
||
| it('User sees Parsers install snippet', () => { | ||
| page.verifyParsersInstallSnippet(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('GitHub Actions', () => { | ||
| beforeEach(() => { | ||
| page.visitGithubActions(); | ||
| }); | ||
|
|
||
| it('User sees the GitHub Actions header', () => { | ||
| page.verifyGhActionsHeader(); | ||
| }); | ||
|
|
||
| it('User verifies GitHub Actions GitHub link', () => { | ||
| page.verifyGhActionsGithubLink(); | ||
| }); | ||
| }); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import ToolsModelinaPage from './pages/toolsModelina'; | ||
|
|
||
| describe('Tools - Modelina Page', () => { | ||
| const page = new ToolsModelinaPage(); | ||
|
|
||
| beforeEach(() => { | ||
| page.visit(); | ||
| }); | ||
|
|
||
| it('User sees the main header and intro', () => { | ||
| page.verifyHeader(); | ||
| }); | ||
|
|
||
| it('User sees install snippet', () => { | ||
| page.verifyInstallSnippet(); | ||
| }); | ||
|
|
||
| it('User verifies GitHub button link', () => { | ||
| page.verifyGithubLink(); | ||
| }); | ||
|
|
||
| it('User verifies Try it now link', () => { | ||
| page.verifyTryItNowLink(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: consider naming class consistently with file name. Reivew these naming in all the files