Playwright with Javascript | How To Create and Run Tests | Part 3
SDET- QA
0:00 / 0:00
Playwright with Javascript | How To Create and Run Tests | Part 3
236 638 просмотров · 3 года назад
SDET- QA
842 тыс. подписчиков
236 638 просмотров · 3 года назад
Step 1 - Create a new file under test folder
Step 2 - Add module ‘playwright/test’
const { test, expect } = require('@playwright/test');
** test, expect ------ functions from @playwright/test module
Playwright Test provides a test function to declare tests and expect function to write assertions
Step 3 - Create a test block - test(title, testFunction)
The keyword 'async' before a function makes the function return a promise
The keyword 'await' before a function makes the function wait for a promise
Step 4 - Run the test
npx playwright test --project=chromium --headed FirstTest.spec.js
npx playwright test runs all tests on all browsers in headless mode
npx playwright test MyTest1.spec.js runs a specific test file
npx playwright test MyTest1.spec.js MyTest2.spec.js runs the files specified
npx playwright test -g "test title" runs test with the title
npx playwright test --project=chromium runs on specific browser
npx playwright test --headed runs tests in headed mode
npx playwright test --debug debug tests
npx playwright test example.spec.js --debug debug specific test file
#########################################
🚀 Udemy Courses 👨💻👩💻
##########################################
🟢 Playwright with TypeScript 🎭📘
👉 https://www.udemy.com/course/learn-pl...
🟡 Playwright with JavaScript 🎭📒
👉 https://www.udemy.com/course/learn-pl...
🤖 Generative AI for Software Testing 🧠💡
👉 https://shorturl.at/Uk2eM
🧪 Manual Testing + Agile with Jira Tool 📋⚙️
👉 https://www.udemy.com/course/learn-ma...
💻 Selenium with Java + Cucumber 🥒☕
👉 https://www.udemy.com/course/learn-se...
🐍 Selenium with Python & PyTest 🐍🧪
👉 https://www.udemy.com/course/learn-se...
🤖 Selenium with Python using Robot Framework 🤖📐
👉 https://www.udemy.com/course/learn-se...
🔌 API Testing (Postman, RestAssured & SoapUI) 🔍🔧
👉 https://www.udemy.com/course/learn-se...
🌐 Web & API Automation using Cypress with JavaScript 💻🧬
👉 https://www.udemy.com/course/learn-cy...
📊 JMeter - Performance Testing 🚀📈
👉 https://www.udemy.com/course/learn-jm...
🧩 SDET Essentials (Full Stack QA) 🧠🔍
👉 https://www.udemy.com/course/learn-sd...
📱 Appium - Mobile Automation Testing 📲🧪
👉 https://www.udemy.com/course/learn-ap...
☕ Java Collections 📚🔄
👉 https://www.udemy.com/course/learn-ja...
🥒 Cucumber BDD Framework 📘💬
👉 https://www.udemy.com/course/learn-cu...
🛠️ Protractor with JavaScript 🔧📐
👉 https://www.udemy.com/course/learn-pr...