-
Notifications
You must be signed in to change notification settings - Fork 8
Move to loginRedirect from loginPopup, and update e2e tests #293
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
83f254e
Move to loginRedirect from loginPopup, and update e2e tests
devksingh4 65d6953
Use e2e test sharding
devksingh4 a1ba20a
Fix comments
devksingh4 3e61b65
Cleanup actions
devksingh4 a603c47
Install playwright without deps
devksingh4 bf13ef5
Use yarn cache for merge reports
devksingh4 5c10708
Install playwright with deps
devksingh4 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
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
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 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.describe('Identity Sync', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('/admin/sync'); | ||
| }); | ||
|
|
||
| test('Page renders with heading', async ({ page }) => { | ||
| const heading = page.locator('h1'); | ||
| await expect(heading).toContainText('Sync Identity'); | ||
| const desc = page.locator('p').first(); | ||
| await expect(desc).toContainText( | ||
| 'Use this tool to setup your account, or update your ACM account with details from your Illinois NetID.' | ||
| ); | ||
| }); | ||
| test('Page provides sync button which leads to login redirect', async ({ | ||
| page, | ||
| }) => { | ||
| await expect( | ||
| page.getByRole('button', { name: 'Sync Identity' }) | ||
| ).toBeVisible(); | ||
| await page.getByRole('button', { name: 'Sync Identity' }).click(); | ||
| await page.waitForURL( | ||
| 'https://login.microsoftonline.com/44467e6f-462c-4ea2-823f-7800de5434e3/oauth2/v2.0/authorize?client_id=d64e9c50-d144-4b4a-a315-ad2ed456c37**' | ||
| ); | ||
| }); | ||
| test('Copyright section is visible', async ({ page }) => { | ||
| const currentYear = new Date().getFullYear(); | ||
| await expect( | ||
| page.getByText(`© ${currentYear} ACM @ UIUC. All rights reserved.`) | ||
| ).toBeVisible(); | ||
| }); | ||
| }); |
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,56 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.describe('Membership Purchase', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('/membership'); | ||
| }); | ||
|
|
||
| test('Page renders with heading and perks', async ({ page }) => { | ||
| const heading = page.locator('h1'); | ||
| await expect(heading).toContainText('Become a Paid Member'); | ||
|
|
||
| const perksList = page.getByTestId('membership-perks'); | ||
| await expect(perksList).toBeVisible(); | ||
| const listItems = perksList.locator('li'); | ||
| expect((await listItems.all()).length).toBeGreaterThan(0); | ||
| }); | ||
| test('Page provides purchase button which leads to login redirect', async ({ | ||
| page, | ||
| }) => { | ||
| await expect( | ||
| page.getByRole('button', { name: 'Purchase Membership' }) | ||
| ).toBeVisible(); | ||
| await page.getByRole('button', { name: 'Purchase Membership' }).click(); | ||
| await page.waitForURL( | ||
| 'https://login.microsoftonline.com/44467e6f-462c-4ea2-823f-7800de5434e3/oauth2/v2.0/authorize?client_id=d64e9c50-d144-4b4a-a315-ad2ed456c37**' | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| test.describe('Membership Check', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('/membership/check'); | ||
| }); | ||
|
|
||
| test('Page renders with heading', async ({ page }) => { | ||
| const heading = page.locator('h1'); | ||
| await expect(heading).toContainText('Check Paid Membership'); | ||
| }); | ||
| test('Page provides check button which leads to login redirect', async ({ | ||
| page, | ||
| }) => { | ||
| await expect( | ||
| page.getByRole('button', { name: 'Check Membership' }) | ||
| ).toBeVisible(); | ||
| await page.getByRole('button', { name: 'Check Membership' }).click(); | ||
| await page.waitForURL( | ||
| 'https://login.microsoftonline.com/44467e6f-462c-4ea2-823f-7800de5434e3/oauth2/v2.0/authorize?client_id=d64e9c50-d144-4b4a-a315-ad2ed456c37**' | ||
| ); | ||
| }); | ||
| test('Copyright section is visible', async ({ page }) => { | ||
| const currentYear = new Date().getFullYear(); | ||
| await expect( | ||
| page.getByText(`© ${currentYear} ACM @ UIUC. All rights reserved.`) | ||
| ).toBeVisible(); | ||
| }); | ||
| }); |
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,29 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| const expectedSections = ['ACM Paid Member Guide', 'CS Cares', 'Feedback']; | ||
| test.describe('Resources', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('resources/'); | ||
| }); | ||
|
|
||
| test('Heading renders with description', async ({ page }) => { | ||
| const heading = page.getByTestId('content-title'); | ||
| const description = page.getByTestId('content-description'); | ||
| await expect(heading).toContainText('Resources'); | ||
| await expect(description).toContainText( | ||
| 'Learn about resources provided to ACM @ UIUC members' | ||
| ); | ||
| }); | ||
| for (const heading of expectedSections) { | ||
| test(`${heading} section is present`, async ({ page }) => { | ||
| const header = page.getByRole('heading', { name: heading }); | ||
| expect(header).toContainText(heading); | ||
| }); | ||
| } | ||
devksingh4 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| test('Copyright section is visible', async ({ page }) => { | ||
| const currentYear = new Date().getFullYear(); | ||
| await expect( | ||
| page.getByText(`© ${currentYear} ACM @ UIUC. All rights reserved.`) | ||
| ).toBeVisible(); | ||
| }); | ||
| }); | ||
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
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
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
Oops, something went wrong.
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.