-
-
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
Open
anushkaaaaaaaa
wants to merge
22
commits into
asyncapi:master
Choose a base branch
from
anushkaaaaaaaa:tscslack
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+339
−1
Open
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c111ab4
test: add e2e tests for tsc, slack and ambassadors page
anushkaaaaaaaa f7f8e6e
fix: update
anushkaaaaaaaa b40bada
Merge branch 'master' into tscslack
anushkaaaaaaaa d408d53
fix: small changes
anushkaaaaaaaa 279a97f
Merge branch 'tscslack' of https://github.com/anushkaaaaaaaa/website …
anushkaaaaaaaa 90bea84
Merge branch 'master' into tscslack
anushkaaaaaaaa 3200b51
Merge branch 'master' into tscslack
anushkaaaaaaaa 21f89ca
feat: add tests for Ambassadors and TSC pages, including social links…
anushkaaaaaaaa f276e0b
Merge branch 'master' into tscslack
anushkaaaaaaaa 6219990
small change
anushkaaaaaaaa f749d19
Merge branch 'tscslack' of https://github.com/anushkaaaaaaaa/website …
anushkaaaaaaaa 47a54aa
refactor: format verifyKeySectionsAndLinks method for improved readab…
anushkaaaaaaaa 1e16720
fix: update link in verifyKeySectionsAndLinks method to correct URL
anushkaaaaaaaa d3bcbf7
Merge branch 'master' into tscslack
anushkaaaaaaaa 0e1d14c
Merge branch 'master' into tscslack
anushkaaaaaaaa 7a15871
test: enhance Slack workspace tests for inactive link handling
anushkaaaaaaaa ca73a27
refactor: streamline link status checks and enhance test structure fo…
anushkaaaaaaaa f703eec
test: ensure visibility checks for Slack login buttons and footer links
anushkaaaaaaaa 7353b76
refactor: remove unused navigation methods for Tools and Docs pages
anushkaaaaaaaa 7196dc4
Merge branch 'master' into tscslack
anushkaaaaaaaa 4921a24
refactor: replace static wait with dynamic page load checks for Slack…
anushkaaaaaaaa 82bf898
Merge branch 'master' into tscslack
anushkaaaaaaaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,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); | ||
| }); | ||
| }); | ||
| }); | ||
|
|
This file contains hidden or 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,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; |
This file contains hidden or 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
This file contains hidden or 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,79 @@ | ||
| class SlackPage { | ||
| visitSlack() { | ||
| cy.visit( | ||
| 'https://asyncapi.slack.com/join/shared_invite/zt-3clk6rmc0-Cujl2fChHYnHDUwFKRlQCw#/shared-invite/email', | ||
| ); | ||
| } | ||
|
|
||
| waitForPageLoad() { | ||
| cy.wait(2000); | ||
| } | ||
|
|
||
| checkLinkStatus(callback) { | ||
| cy.get('body').then(($body) => { | ||
| const isInactive = | ||
| $body.find('.p-refreshed_page__heading').length > 0 && | ||
| $body.text().includes('This link is no longer active'); | ||
| callback(isInactive); | ||
| }); | ||
| } | ||
|
|
||
| verifyInactiveLinkMessage() { | ||
| cy.get('.p-refreshed_page__heading') | ||
| .should('be.visible') | ||
| .and('have.text', 'This link is no longer active'); | ||
| } | ||
|
|
||
| verifyAllLoginMethods() { | ||
| this.verifyGoogleLoginButton(); | ||
| this.verifyAppleLoginButton(); | ||
| this.verifyContinueWithEmail(); | ||
| } | ||
|
|
||
| verifyAllFooterLinks() { | ||
| this.verifyPrivacyAndTerms(); | ||
| this.verifyContactUs(); | ||
| this.verifyChangeRegion(); | ||
| } | ||
|
|
||
| verifyGoogleLoginButton() { | ||
| cy.get('[data-qa="base_google_login_button"]') | ||
| .should('be.visible') | ||
| .and('have.id', 'google_login_button') | ||
| .and('have.attr', 'type', 'button'); | ||
| } | ||
|
|
||
| verifyAppleLoginButton() { | ||
| cy.get('[data-qa="base_apple_login_button"]') | ||
| .should('be.visible') | ||
| .and('have.id', 'apple_login_button') | ||
| .and('have.attr', 'href') | ||
| .and('include', 'slack.com/shared-invite/oauth/apple/start'); | ||
| } | ||
|
|
||
| verifyContinueWithEmail() { | ||
| cy.get('[data-qa="join_with_email"]') | ||
| .should('be.visible') | ||
| .and('have.attr', 'type', 'button'); | ||
| } | ||
|
|
||
| verifyPrivacyAndTerms() { | ||
| cy.get('[href="/legal"]') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', '/legal'); | ||
| } | ||
|
|
||
| verifyContactUs() { | ||
| cy.get('[href="/help/requests/new"]') | ||
| .should('be.visible') | ||
| .and('have.attr', 'href', '/help/requests/new'); | ||
| } | ||
|
|
||
| verifyChangeRegion() { | ||
| cy.get('a[href="#"]') | ||
| .should('be.visible') | ||
| .and('contain.text', 'Change region'); | ||
| } | ||
| } | ||
|
|
||
| export default SlackPage; | ||
This file contains hidden or 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 @@ | ||
|
|
||
| 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; | ||
|
|
This file contains hidden or 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,36 @@ | ||
| import SlackPage from './pages/slack'; | ||
|
|
||
| describe('Slack workspace tests', () => { | ||
| const slackPage = new SlackPage(); | ||
|
|
||
| beforeEach(() => { | ||
| slackPage.visitSlack(); | ||
| }); | ||
|
|
||
| it('User can access all login methods', () => { | ||
| slackPage.waitForPageLoad(); | ||
| slackPage.checkLinkStatus((isInactive) => { | ||
| if (isInactive) { | ||
| slackPage.verifyInactiveLinkMessage(); | ||
| } else { | ||
| slackPage.verifyAllLoginMethods(); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| it('Should handle inactive Slack invite link gracefully', () => { | ||
| slackPage.checkLinkStatus((isInactive) => { | ||
| if (isInactive) { | ||
| slackPage.verifyInactiveLinkMessage(); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| it('User can view links for Privacy, Contact Us, and Region Change', () => { | ||
| slackPage.checkLinkStatus((isInactive) => { | ||
| if (!isInactive) { | ||
| slackPage.verifyAllFooterLinks(); | ||
| } | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or 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,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).should('be.visible'); | ||
| }); | ||
| }); | ||
|
|
||
| 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); | ||
| }); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.