Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: windows-latest #ubuntu-latest #windows-latest #macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: windows-latest #ubuntu-latest #windows-latest #macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
33 changes: 33 additions & 0 deletions .github/workflows/playwrightUseAllureReport
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# name: Playwright Tests
# on:
# push:
# branches: [ main, master ]
# pull_request:
# branches: [ main, master ]
# jobs:
# test:
# timeout-minutes: 60
# runs-on: windows-latest #ubuntu-latest #windows-latest #macos-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: lts/*
# - name: Install dependencies
# run: npm ci
# - name: Install Playwright Browsers
# run: npx playwright install --with-deps
# - name: Install Allure Playwright
# run: npm install allure-playwright
# - name: Install Allure Command line
# run: npm install -g allure-commandline --save-dev
# - name: Run Playwrighr Test
# run: npx playwright test --reporter=allure-playwright
# - name: Generate Allure report
# run: allure generate allure-results --clean
# - uses: actions/upload-artifact@v4
# if: always()
# with:
# name: allure-report
# path: allure-report/
# retention-days: 30
33 changes: 0 additions & 33 deletions .github/workflows/playwrightUseAllureReport.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ node_modules/
/allure-report/
/allure-results/
.vscode/
/playwright/.auth/

# Playwright
/playwright/.cache/
124 changes: 62 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@

# playwright-tutorials-typescript-javascript

Playwright with TypeScript/JavaScript: YouTube Tutorials
This repo contains source code for a YouTube tutorial series on Playwright using TypeScript/JavaScript. Learn to set up, write, and run end-to-end tests for modern web apps. Ideal for beginners and those aiming to enhance their test automation skills with Playwright.


## Prerequisite

* Latest Node Version should be installed
* Visual Studio Code
* PlayWright Extension (Optional - Good to have)


## Clone Command
git clone https://github.com/Wish-Infinite/playwright-tutorials-typescript-javascript.git


## Post Cloning Command to install Node packages
npm install

## Note
**All the Test Scripts Used in Playwright Tutorials Playlist Can be found in "archive" folder at - https://github.com/Wish-Infinite/playwright-tutorials-typescript-javascript/tree/main/archive**

<br><br><br>

======================================================================

<h1 align="center">Hi 👋, Everyone</h1>
<h3 align="center">"WishInfinite : Your go-to channel for mastering Software testing, Coding, and Automation. Join me for expert insights, tutorials, and tips !!"</h3>

<p align="left"> <img src="https://komarev.com/ghpvc/?username=wish-infinite&label=Profile%20views&color=0e75b6&style=flat" alt="wish-infinite" /> </p>

- 🔭 I’m currently working on [Playwright Tutorials creation on Youtube](youtube.com/@WishInfinite)

- 📫 How to reach me **wishinfinite01@gmail.com**

<h3 align="left">Connect with me:</h3>
<p align="left">
<a href="https://www.youtube.com/c/@wishinfinite" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/youtube.svg" alt="@wishinfinite" height="30" width="40" /></a>
<a href="https://twitter.com/_wishinfinite" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg" alt="_wishinfinite" height="30" width="40" /></a>
<a href="https://fb.com/wishinfinitepage" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/facebook.svg" alt="wishinfinitepage" height="30" width="40" /></a>
<a href="https://instagram.com/wishinfinite" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="wishinfinite" height="30" width="40" /></a>
<a href="https://discord.gg/0029VaG3UI3J3jv0tGVaUT2s" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/discord.svg" alt="0029VaG3UI3J3jv0tGVaUT2s" height="30" width="40" /></a>
</p>

<h3 align="left">Languages and Tools:</h3>
<p align="left">
<a href="https://angular.io" target="_blank" rel="noreferrer"> <img src="https://angular.io/assets/images/logos/angular/angular.svg" alt="angular" width="40" height="40"/> </a>
<a href="https://reactjs.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/react/react-original-wordmark.svg" alt="react" width="40" height="40"/> </a>
<a href="https://www.w3.org/html/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original-wordmark.svg" alt="html5" width="40" height="40"/> </a>
<a href="https://www.w3schools.com/css/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/css3/css3-original-wordmark.svg" alt="css3" width="40" height="40"/> </a>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg" alt="javascript" width="40" height="40"/> </a>
<a href="https://www.typescriptlang.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/typescript/typescript-original.svg" alt="typescript" width="40" height="40"/> </a>
<a href="https://getbootstrap.com" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/bootstrap/bootstrap-plain-wordmark.svg" alt="bootstrap" width="40" height="40"/> </a>
<a href="https://www.selenium.dev" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/detain/svg-logos/780f25886640cef088af994181646db2f6b1a3f8/svg/selenium-logo.svg" alt="selenium" width="40" height="40"/> </a>
<a href="https://www.cypress.io" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/simple-icons/simple-icons/6e46ec1fc23b60c8fd0d2f2ff46db82e16dbd75f/icons/cypress.svg" alt="cypress" width="40" height="40"/> </a>
<a href="https://www.java.com" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/java/java-original.svg" alt="java" width="40" height="40"/> </a>
<a href="https://nodejs.org" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original-wordmark.svg" alt="nodejs" width="40" height="40"/> </a>
<a href="https://azure.microsoft.com/en-in/" target="_blank" rel="noreferrer"> <img src="https://www.vectorlogo.zone/logos/microsoft_azure/microsoft_azure-icon.svg" alt="azure" width="40" height="40"/> </a>
<a href="https://www.jenkins.io" target="_blank" rel="noreferrer"> <img src="https://www.vectorlogo.zone/logos/jenkins/jenkins-icon.svg" alt="jenkins" width="40" height="40"/> </a>
</p>
# playwright-tutorials-typescript-javascript
Playwright with TypeScript/JavaScript: YouTube Tutorials
This repo contains source code for a YouTube tutorial series on Playwright using TypeScript/JavaScript. Learn to set up, write, and run end-to-end tests for modern web apps. Ideal for beginners and those aiming to enhance their test automation skills with Playwright.
## Prerequisite
* Latest Node Version should be installed
* Visual Studio Code
* PlayWright Extension (Optional - Good to have)
## Clone Command
git clone https://github.com/Wish-Infinite/playwright-tutorials-typescript-javascript.git
## Post Cloning Command to install Node packages
npm install
## Note
**All the Test Scripts Used in Playwright Tutorials Playlist Can be found in "archive" folder at - https://github.com/Wish-Infinite/playwright-tutorials-typescript-javascript/tree/main/archive**
<br><br><br>
======================================================================
<h1 align="center">Hi 👋, Everyone</h1>
<h3 align="center">"WishInfinite : Your go-to channel for mastering Software testing, Coding, and Automation. Join me for expert insights, tutorials, and tips !!"</h3>
<p align="left"> <img src="https://komarev.com/ghpvc/?username=wish-infinite&label=Profile%20views&color=0e75b6&style=flat" alt="wish-infinite" /> </p>
- 🔭 I’m currently working on [Playwright Tutorials creation on Youtube](youtube.com/@WishInfinite)
- 📫 How to reach me **wishinfinite01@gmail.com**
<h3 align="left">Connect with me:</h3>
<p align="left">
<a href="https://www.youtube.com/c/@wishinfinite" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/youtube.svg" alt="@wishinfinite" height="30" width="40" /></a>
<a href="https://twitter.com/_wishinfinite" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/twitter.svg" alt="_wishinfinite" height="30" width="40" /></a>
<a href="https://fb.com/wishinfinitepage" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/facebook.svg" alt="wishinfinitepage" height="30" width="40" /></a>
<a href="https://instagram.com/wishinfinite" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="wishinfinite" height="30" width="40" /></a>
<a href="https://discord.gg/0029VaG3UI3J3jv0tGVaUT2s" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/discord.svg" alt="0029VaG3UI3J3jv0tGVaUT2s" height="30" width="40" /></a>
</p>
<h3 align="left">Languages and Tools:</h3>
<p align="left">
<a href="https://angular.io" target="_blank" rel="noreferrer"> <img src="https://angular.io/assets/images/logos/angular/angular.svg" alt="angular" width="40" height="40"/> </a>
<a href="https://reactjs.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/react/react-original-wordmark.svg" alt="react" width="40" height="40"/> </a>
<a href="https://www.w3.org/html/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original-wordmark.svg" alt="html5" width="40" height="40"/> </a>
<a href="https://www.w3schools.com/css/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/css3/css3-original-wordmark.svg" alt="css3" width="40" height="40"/> </a>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg" alt="javascript" width="40" height="40"/> </a>
<a href="https://www.typescriptlang.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/typescript/typescript-original.svg" alt="typescript" width="40" height="40"/> </a>
<a href="https://getbootstrap.com" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/bootstrap/bootstrap-plain-wordmark.svg" alt="bootstrap" width="40" height="40"/> </a>
<a href="https://www.selenium.dev" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/detain/svg-logos/780f25886640cef088af994181646db2f6b1a3f8/svg/selenium-logo.svg" alt="selenium" width="40" height="40"/> </a>
<a href="https://www.cypress.io" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/simple-icons/simple-icons/6e46ec1fc23b60c8fd0d2f2ff46db82e16dbd75f/icons/cypress.svg" alt="cypress" width="40" height="40"/> </a>
<a href="https://www.java.com" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/java/java-original.svg" alt="java" width="40" height="40"/> </a>
<a href="https://nodejs.org" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/nodejs/nodejs-original-wordmark.svg" alt="nodejs" width="40" height="40"/> </a>
<a href="https://azure.microsoft.com/en-in/" target="_blank" rel="noreferrer"> <img src="https://www.vectorlogo.zone/logos/microsoft_azure/microsoft_azure-icon.svg" alt="azure" width="40" height="40"/> </a>
<a href="https://www.jenkins.io" target="_blank" rel="noreferrer"> <img src="https://www.vectorlogo.zone/logos/jenkins/jenkins-icon.svg" alt="jenkins" width="40" height="40"/> </a>
</p>
126 changes: 63 additions & 63 deletions archive/VId52_APITestingAuthentication.spec.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
import { expect, test } from "@playwright/test"


let tokenValue;
test.beforeAll("Basic Auth", async ({ request }) => {
const respToken = await request.post("https://restful-booker.herokuapp.com/auth", {
data: {
"username": "admin",
"password": "password123"
}
})
tokenValue = (await respToken.json()).token;
})

test("Authentication of Put Call using basic auth",async({request})=>{
const respPut = await request.put("https://restful-booker.herokuapp.com/booking/1",{
headers:{
Cookie:"token=" + tokenValue
},
data:{
"firstname" : "WishInfinite",
"lastname" : "Brown",
"totalprice" : 111,
"depositpaid" : true,
"bookingdates" : {
"checkin" : "2018-01-01",
"checkout" : "2019-01-01"
},
"additionalneeds" : "Breakfast"
}
});

expect(respPut.status()).toBe(200);
})

test("Authentication of Delete Call using basic auth",async({request})=>{
const respDelete = await request.delete("https://restful-booker.herokuapp.com/booking/1",{
headers:{
Cookie:"token=" + tokenValue
}
})
expect(respDelete.status()).toBe(201);
})

// test("Authentication with API Key",async({request})=>{
// const resp = await request.put("https://restful-booker.herokuapp.com/booking/1",{
// headers:{
// Authorization:"Basic YWRtaW46cGFzc3dvcmQxMjM="
// },
// data:{
// "firstname" : "WishInfinite",
// "lastname" : "Brown",
// "totalprice" : 111,
// "depositpaid" : true,
// "bookingdates" : {
// "checkin" : "2018-01-01",
// "checkout" : "2019-01-01"
// },
// "additionalneeds" : "Breakfast"
// }
// })

// expect(resp.status()).toBe(200);
import { expect, test } from "@playwright/test"
let tokenValue;
test.beforeAll("Basic Auth", async ({ request }) => {
const respToken = await request.post("https://restful-booker.herokuapp.com/auth", {
data: {
"username": "admin",
"password": "password123"
}
})
tokenValue = (await respToken.json()).token;
})
test("Authentication of Put Call using basic auth",async({request})=>{
const respPut = await request.put("https://restful-booker.herokuapp.com/booking/1",{
headers:{
Cookie:"token=" + tokenValue
},
data:{
"firstname" : "WishInfinite",
"lastname" : "Brown",
"totalprice" : 111,
"depositpaid" : true,
"bookingdates" : {
"checkin" : "2018-01-01",
"checkout" : "2019-01-01"
},
"additionalneeds" : "Breakfast"
}
});
expect(respPut.status()).toBe(200);
})
test("Authentication of Delete Call using basic auth",async({request})=>{
const respDelete = await request.delete("https://restful-booker.herokuapp.com/booking/1",{
headers:{
Cookie:"token=" + tokenValue
}
})
expect(respDelete.status()).toBe(201);
})
// test("Authentication with API Key",async({request})=>{
// const resp = await request.put("https://restful-booker.herokuapp.com/booking/1",{
// headers:{
// Authorization:"Basic YWRtaW46cGFzc3dvcmQxMjM="
// },
// data:{
// "firstname" : "WishInfinite",
// "lastname" : "Brown",
// "totalprice" : 111,
// "depositpaid" : true,
// "bookingdates" : {
// "checkin" : "2018-01-01",
// "checkout" : "2019-01-01"
// },
// "additionalneeds" : "Breakfast"
// }
// })
// expect(resp.status()).toBe(200);
// })
Loading
Loading