-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
189 additions
and
11 deletions.
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
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
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
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
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,56 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { loggedInAsUser } from './utils'; | ||
|
||
test.describe('Certificate Page', () => { | ||
loggedInAsUser(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/certificate'); | ||
}); | ||
|
||
test('Request a Certificate', async ({ page }) => { | ||
const titleHeader = page.getByRole('heading', { name: 'Certificate' }); | ||
const domainName = page.getByText('user1.starchart.com'); | ||
|
||
await expect(domainName).toContainText('user1.starchart.com'); | ||
await expect(titleHeader).toContainText('Certificate'); | ||
|
||
await page.getByRole('button', { name: 'Request a Certificate' }).click(); | ||
|
||
const loadingPageText = page | ||
.locator('div') | ||
.filter({ | ||
hasText: 'We have received your request, and will notify you when your certificate is read', | ||
}) | ||
.nth(1); | ||
|
||
await loadingPageText.waitFor(); | ||
|
||
//Copy Key Toast Text | ||
await page.getByRole('button', { name: 'Copy Public Key' }).click(); | ||
await page.getByRole('button', { name: 'Copy Private Key' }).click(); | ||
|
||
const publicCopyToastText = page.getByText('Public Key was copied to the clipboard'); | ||
const privateCopyToastText = page.getByText('Private Key was copied to the clipboard'); | ||
|
||
await publicCopyToastText.waitFor(); | ||
await privateCopyToastText.waitFor(); | ||
|
||
//Download Key Toast Text | ||
await page.getByRole('button', { name: 'Download Public Key' }).click(); | ||
await page.getByRole('button', { name: 'Download Private Key' }).click(); | ||
|
||
const publicDownloadToastText = page.getByText('Public Key is Downloaded'); | ||
const privateDownloadToastText = page.getByText('Private Key is Downloaded'); | ||
|
||
await publicDownloadToastText.waitFor(); | ||
await privateDownloadToastText.waitFor(); | ||
|
||
//Text Titles | ||
const publicKey = page.getByRole('heading', { name: 'Public Key' }); | ||
const privateKey = page.getByRole('heading', { name: 'Private Key' }); | ||
|
||
await expect(publicKey).toContainText('Public Key'); | ||
await expect(privateKey).toContainText('Private Key'); | ||
}); | ||
}); |
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,18 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { loggedInAsUser } from '../utils'; | ||
|
||
test.describe('navigate to links', () => { | ||
loggedInAsUser(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('navigate to certificate and domain (desktop)', async ({ page }) => { | ||
await page.getByRole('link', { name: 'Certificate', exact: true }).click(); | ||
await expect(page).toHaveURL('/certificate'); | ||
|
||
await page.getByRole('link', { name: 'Domains', exact: true }).click(); | ||
await expect(page).toHaveURL('/domains'); | ||
}); | ||
}); |
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,20 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { loggedInAsUser } from '../utils'; | ||
|
||
test.describe('navigate to links through mobile', () => { | ||
loggedInAsUser(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('navigate to certificate and domain (mobile)', async ({ page }) => { | ||
await page.click('.header-hamburger'); | ||
await page.getByRole('link', { name: 'Certificate', exact: true }).click(); | ||
await expect(page).toHaveURL('/certificate'); | ||
|
||
await page.click('.header-hamburger'); | ||
await page.getByRole('link', { name: 'Domains', exact: true }).click(); | ||
await expect(page).toHaveURL('/domains'); | ||
}); | ||
}); |
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,16 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { loggedInAsUser } from '../utils'; | ||
|
||
test.describe('sign out of the account', () => { | ||
loggedInAsUser(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('sign out', async ({ page }) => { | ||
await page.getByRole('banner').getByRole('button').click(); | ||
await page.getByRole('menuitem', { name: 'Sign Out' }).click(); | ||
await expect(page).toHaveURL('/login?redirectTo=%2F'); | ||
}); | ||
}); |
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,55 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { loggedInAsUser } from './utils'; | ||
|
||
test.describe('Landing Page', () => { | ||
loggedInAsUser(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/'); | ||
}); | ||
|
||
test('Contains DNS Record and Certificate cards', async ({ page }) => { | ||
const dnsCard = page.getByRole('heading', { name: 'DNS Records' }); | ||
const certCard = page.getByRole('heading', { name: 'Certificate' }); | ||
|
||
await expect(dnsCard).toContainText('DNS Records'); | ||
await expect(certCard).toContainText('Certificate'); | ||
}); | ||
|
||
test('Manage DNS Records Button', async ({ page }) => { | ||
await page.getByRole('link', { name: 'Manage DNS Records' }).click(); | ||
|
||
await expect(page).toHaveURL('/domains'); | ||
}); | ||
|
||
test('DNS Records Instructions Link', async ({ page }) => { | ||
await page | ||
.getByRole('paragraph') | ||
.filter({ | ||
hasText: 'DNS Record: Lorem Ipsum is simply dummy text of the printing and typesetting ind', | ||
}) | ||
.getByRole('link', { name: 'to learn more, see these instructions...' }) | ||
.click(); | ||
|
||
await expect(page).toHaveURL('/domains/instructions'); | ||
}); | ||
|
||
test('Manage Certificate Button', async ({ page }) => { | ||
await page.getByRole('link', { name: 'Manage Certificate' }).click(); | ||
|
||
await expect(page).toHaveURL('/certificate'); | ||
}); | ||
|
||
test('Certificate Instructions Link', async ({ page }) => { | ||
await page | ||
.getByRole('paragraph') | ||
.filter({ | ||
hasText: | ||
'Certificate: Lorem Ipsum is simply dummy text of the printing and typesetting ind', | ||
}) | ||
.getByRole('link', { name: 'to learn more, see these instructions...' }) | ||
.click(); | ||
|
||
await expect(page).toHaveURL('/certificate/instructions'); | ||
}); | ||
}); |
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
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