-
-
Notifications
You must be signed in to change notification settings - Fork 1k
test: add e2e tests for tsc, slack and ambassadors page #4244
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
base: master
Are you sure you want to change the base?
Changes from 14 commits
c111ab4
f7f8e6e
b40bada
d408d53
279a97f
90bea84
3200b51
21f89ca
f276e0b
6219990
f749d19
47a54aa
1e16720
d3bcbf7
0e1d14c
7a15871
ca73a27
f703eec
7353b76
7196dc4
4921a24
82bf898
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,52 @@ | ||
| import HomePage from './pages/homepage'; | ||
| import AmbassadorsPage from './pages/ambassadors'; | ||
|
|
||
| let homePage; | ||
| let ambassadorsPage; | ||
|
|
||
| beforeEach(() => { | ||
| homePage = new HomePage(); | ||
| ambassadorsPage = new AmbassadorsPage(); | ||
| homePage.visit(); | ||
| homePage.goToAmbassadorsPage(); | ||
| }); | ||
|
|
||
| describe('Ambassadors Page', () => { | ||
| it('verifies key sections and links', () => { | ||
| ambassadorsPage.verifyKeySectionsAndLinks(); | ||
| }); | ||
|
|
||
| it('verifies social links for selected Ambassadors', () => { | ||
| const ambassadors = [ | ||
| { | ||
| name: 'Quetzalli Writes', | ||
| links: { | ||
| github: 'https://www.github.com/quetzalliwrites', | ||
| twitter: 'https://www.twitter.com/QuetzalliWrites', | ||
| linkedin: 'https://www.linkedin.com/in/quetzalli-writes' | ||
| } | ||
| }, | ||
| { | ||
| name: 'Daniel Kocot', | ||
| links: { | ||
| github: 'https://www.github.com/danielkocot', | ||
| twitter: 'https://www.twitter.com/dk_1977', | ||
| linkedin: 'https://www.linkedin.com/in/danielkocot' | ||
| } | ||
| }, | ||
| { | ||
| name: 'Hugo Guerrero', | ||
| links: { | ||
| github: 'https://www.github.com/hguerrero', | ||
| twitter: 'https://www.twitter.com/hguerreroo', | ||
| linkedin: 'https://www.linkedin.com/in/hugoguerrero' | ||
| } | ||
| } | ||
| ]; | ||
|
|
||
| ambassadors.forEach(({ name, links }) => { | ||
| ambassadorsPage.verifyAmbassadorSocialLinks(name, links); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| class AmbassadorsPage { | ||
| visit() { | ||
| cy.visit('/community/ambassadors'); | ||
| } | ||
|
|
||
| verifyKeySectionsAndLinks() { | ||
| cy.get('a[href="https://github.com/asyncapi/community/blob/master/docs/020-governance-and-policies/AMBASSADOR_PROGRAM.md"]' | ||
| ) | ||
| .should('be.visible'); | ||
| cy.get('[data-testid="Ambassadors-Iframe"]') | ||
| .should('be.visible'); | ||
| cy.get('[data-testid="Ambassadors-members-main"]') | ||
| .should('be.visible'); | ||
| cy.get('a[href="https://github.com/asyncapi/community/blob/master/AMBASSADOR_ORGANIZATION.md#are-you-interested-in-becoming-an-official-asyncapi-ambassador"]') | ||
| .should('be.visible'); | ||
| cy.get('a[href="https://www.asyncapi.com/blog/asyncapi-ambassador-program"]') | ||
| .should('be.visible'); | ||
|
|
||
| } | ||
|
|
||
| verifyAmbassadorSocialLinks(name, links) { | ||
|
|
||
| cy.contains('[data-testid="Ambassadors-members-details"]', name) | ||
| .closest('[data-testid="Ambassadors-members"]') | ||
| .within(() => { | ||
| if (links.twitter) cy.get(`a[href="${links.twitter}"]`).should('be.visible'); | ||
| if (links.github) cy.get(`a[href="${links.github}"]`).should('be.visible'); | ||
| if (links.linkedin) cy.get(`a[href="${links.linkedin}"]`).should('be.visible'); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| export default AmbassadorsPage; |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||
| class SlackPage { | ||||||||||||||
|
|
||||||||||||||
| visitSlack(){ | ||||||||||||||
| cy.visit('https://asyncapi.slack.com/join/shared_invite/zt-3clk6rmc0-Cujl2fChHYnHDUwFKRlQCw#/shared-invite/email'); | ||||||||||||||
| } | ||||||||||||||
|
||||||||||||||
| visitSlack(){ | |
| cy.visit('https://asyncapi.slack.com/join/shared_invite/zt-3clk6rmc0-Cujl2fChHYnHDUwFKRlQCw#/shared-invite/email'); | |
| } | |
| visitSlack(){ | |
| cy.visit(Cypress.env('SLACK_INVITE_URL')); | |
| } |
🤖 Prompt for AI Agents
In cypress/pages/slack.js around lines 3 to 5 the Slack invite URL is hardcoded
with a time-limited token which will expire and break tests; replace the
hardcoded URL by reading it from configuration (CYPRESS_ENV, cypress.env.json or
a config file) or an environment variable, add fallback validation that the
variable exists and fail fast with a clear message, and update project docs to
show how to rotate/update the invite or add a script to generate a fresh invite
via Slack API if available.
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
|
|
||
| class TSCPage { | ||
|
|
||
|
|
||
| hoverCommunityLink() { | ||
| cy.get('[data-testid="NavItem-Link"]').contains('Community').trigger('mouseover'); | ||
| } | ||
|
|
||
| fillNewsletterForm(name, email) { | ||
| cy.get('[data-testid="NewsletterSubscribe-text-input"]').type(name); | ||
| cy.get('[data-testid="NewsletterSubscribe-email-input"]').type(email); | ||
| } | ||
|
|
||
| submitNewsletter() { | ||
| cy.get('[data-testid="Button-main"]').click(); | ||
| } | ||
|
|
||
| getSuccessMessage() { | ||
| return cy.get('[data-testid="Paragraph-test"]').contains( | ||
| `You'll receive an email whenever someone requests the TSC to vote.` | ||
| ); | ||
| } | ||
|
|
||
| getFailureMessage() { | ||
| return cy.get('[data-testid="Paragraph-test"]').contains(`Subscription failed, please let us know about it by submitting a bug`) | ||
| } | ||
| verifyMemberSocialLinks(name, links) { | ||
| cy.contains('[data-testid="UserInfo-name"]', name) | ||
| .closest('[data-testid="UserInfo-list"]') | ||
| .within(() => { | ||
| if (links.GitHub) cy.get(`a[href="${links.GitHub}"]`).should('be.visible'); | ||
| if (links.Twitter) cy.get(`a[href="${links.Twitter}"]`).should('be.visible'); | ||
| if (links.Linkedin) cy.get(`a[href="${links.Linkedin}"]`).should('be.visible'); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| export default TSCPage; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import SlackPage from './pages/slack'; | ||
|
|
||
| describe('Slack workspace tests', () => { | ||
| const slackPage = new SlackPage(); | ||
|
|
||
| beforeEach(() => { | ||
| slackPage.visitSlack(); | ||
| }); | ||
|
|
||
| it('User can access all login methods', () => { | ||
| slackPage.verifyGoogleLoginButton(); | ||
| slackPage.verifyAppleLoginButton(); | ||
| slackPage.verifyContinueWithEmail(); | ||
| }); | ||
|
|
||
| it('User can view links for Privacy, Contact Us, and Region Change', () => { | ||
| slackPage.verifyPrivacyAndTerms(); | ||
| slackPage.verifyContactUs(); | ||
| slackPage.verifyChangeRegion(); | ||
| }); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| import HomePage from './pages/homepage'; | ||
| import TSCPage from './pages/tscpage'; | ||
|
|
||
| let homePage; | ||
| let tscpage; | ||
|
|
||
| beforeEach(() => { | ||
| homePage = new HomePage(); | ||
| tscpage = new TSCPage(); | ||
| homePage.visit(); | ||
| homePage.goToTSCPage(); | ||
| }); | ||
|
|
||
| describe('TSC Newsletter Subscription', () => { | ||
| it('should succeed in subscribing to the newsletter', () => { | ||
| tscpage.fillNewsletterForm('anushka', '[email protected]'); | ||
| tscpage.submitNewsletter(); | ||
| tscpage.getSuccessMessage().should('be.visible'); | ||
| }); | ||
|
|
||
| it('should show correct failure message', () => { | ||
| tscpage.fillNewsletterForm('aditi', 'kerghjh@fhgj'); | ||
| tscpage.submitNewsletter(); | ||
| tscpage.getFailureMessage().should('be.visible'); | ||
| }); | ||
anushkaaaaaaaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| it('verifies key links on the TSC page', () => { | ||
| const linksToVerify = [ | ||
| { | ||
| href: 'https://github.com/asyncapi/community/blob/master/TSC_MEMBERSHIP.md', | ||
| label: 'Link', | ||
| }, | ||
| { | ||
| href: 'https://github.com/asyncapi/community/blob/master/CHARTER.md', | ||
| label: 'Open Governance Model', | ||
| }, | ||
| { | ||
| href: 'https://www.asyncapi.com/blog/governance-motivation', | ||
| label: 'this', | ||
| }, | ||
| ]; | ||
|
|
||
| linksToVerify.forEach(({ href, label }) => { | ||
| cy.get(`a[href="${href}"]`).contains(label); | ||
| }); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| it('verifies social links for selected TSC members', () => { | ||
|
|
||
| const members = [ | ||
| { | ||
| name: 'Aishat Muibudeen', | ||
| links: { | ||
| GitHub: 'https://www.github.com/Mayaleeeee', | ||
| Twitter: 'https://www.twitter.com/maya_ux_ui', | ||
| Linkedin: 'https://www.linkedin.com/in/aishatmuibudeen' | ||
| } | ||
| }, | ||
| { | ||
| name: 'Khuda Dad Nomani', | ||
| links: { | ||
| GitHub: 'https://www.github.com/KhudaDad414', | ||
| Twitter: 'https://www.twitter.com/KhudaDadNomani', | ||
| Linkedin: 'https://www.linkedin.com/in/khudadadnomani' | ||
| } | ||
| }, | ||
| { | ||
| name: 'Lukasz Gornicki', | ||
| links: { | ||
| GitHub: 'https://www.github.com/derberg', | ||
| Twitter: 'https://www.twitter.com/derberq', | ||
| Linkedin: 'https://www.linkedin.com/in/lukasz-gornicki-a621914' | ||
| } | ||
| } | ||
| ]; | ||
|
|
||
| members.forEach(({ name, links }) => { | ||
| tscpage.verifyMemberSocialLinks(name, links); | ||
| }); | ||
| }); | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.