-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First demo - Commit with all test cases
- Loading branch information
1 parent
ba4eac6
commit 9969244
Showing
6 changed files
with
106 additions
and
7 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,61 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
const { login } = require('../utils/login'); | ||
|
||
test('Fellow LinkedIn creation/update', async ({ page }) => { | ||
console.log('Starting test'); | ||
|
||
// Function to generate a random string of characters | ||
function generateRandomString(length) { | ||
const characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; | ||
let result = ''; | ||
for (let i = 0; i < length; i++) { | ||
result += characters.charAt(Math.floor(Math.random() * characters.length)); | ||
} | ||
return result; | ||
} | ||
|
||
// Navigate to the website | ||
await page.goto('/'); | ||
console.log('Navigated to homepage'); | ||
|
||
// Check if the page title contains 'Sign In with Auth0' | ||
await expect(page).toHaveTitle(/Sign In with Auth0/); | ||
console.log('Title verified'); | ||
|
||
// Perform login | ||
await login(page); | ||
await expect(page).toHaveTitle(/Expert Client/); | ||
const postLoginTitle = await page.title(); | ||
console.log('Page title after login:', postLoginTitle); | ||
console.log('Login Successful'); | ||
|
||
// Click on 'Add fellow update' button | ||
await page.getByRole('button', { name: 'Add fellow update' }).click(); | ||
console.log('Clicked on Add fellow update button'); | ||
|
||
// Search and select fellow | ||
await page.getByPlaceholder('Search fellow by name').click(); | ||
await page.getByPlaceholder('Search fellow by name').fill(''); | ||
await page.getByRole('option', { name: 'Engineer Test' }).click(); | ||
console.log('Selected fellow: Engineer Test'); | ||
|
||
// Click Next | ||
await page.getByRole('button', { name: 'Next' }).click(); | ||
console.log('Proceeded to next step'); | ||
|
||
// Generate a random LinkedIn link | ||
const randomLinkedInLink = `https://www.linkedin.com/in/${generateRandomString(8)}-test-${generateRandomString(8)}/`; | ||
|
||
// Fill the textbox with the generated LinkedIn link | ||
const textbox = page.getByRole('textbox'); | ||
await textbox.fill(randomLinkedInLink); | ||
console.log('Filled textbox with generated LinkedIn link:', randomLinkedInLink); | ||
|
||
// Assertion to check that the correct link was filled | ||
await expect(textbox).toHaveValue(randomLinkedInLink); | ||
console.log('Assertion passed: The correct link was filled in the textbox.'); | ||
|
||
// Click Save | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
console.log('Clicked Save button'); | ||
}); |
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,38 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
const { login } = require('../utils/login'); | ||
|
||
test('Review Fellow interaction History', async ({ page }) => { | ||
console.log('Starting test'); | ||
// Navigate to the website | ||
await page.goto('/'); | ||
console.log('Navigated to homepage'); | ||
|
||
// Check if the page title contains 'Sign In with Auth0' | ||
await expect(page).toHaveTitle(/Sign In with Auth0/); | ||
console.log('Title verified'); | ||
|
||
// Perform login | ||
await login(page); | ||
await expect(page).toHaveTitle(/Expert Client/); | ||
const postLoginTitle = await page.title(); | ||
console.log('Page title after login:', postLoginTitle); | ||
console.log('Login Successful'); | ||
|
||
// Click on gridcell 'Engineer Test' | ||
const gridCell = page.getByRole('gridcell', { name: 'Engineer Test' }); | ||
await expect(gridCell).toBeVisible(); | ||
await gridCell.click(); | ||
console.log('Assertion passed: Engineer Test gridcell is visible and clicked.'); | ||
|
||
// Click on 'Interactions' | ||
const interactionsLabel = page.getByLabel('Interactions'); | ||
await expect(interactionsLabel).toBeVisible(); | ||
await interactionsLabel.click(); | ||
console.log('Assertion passed: Interactions label is visible and clicked.'); | ||
|
||
// Click on 'Status' inside the fellow drawer | ||
const statusLabel = page.getByTestId('fellow-drawer').getByLabel('Status'); | ||
await expect(statusLabel).toBeVisible(); | ||
await statusLabel.click(); | ||
console.log('Assertion passed: Status label inside fellow drawer is visible and clicked.'); | ||
}); |