This repository is a functional test framework using Playwright and BrowserStack with Node.js. It utilises the Page Object Model to run 2 basic tests of the login functionality at https://www.saucedemo.com/. The tests run on Firefox, Safari, and Chrome locally, and on additional devices through BrowserStack.
Ensure you have Node.js and npm installed. If not, download and install them from Node.js.
Clone the repository and install the dependencies:
git clone https://github.com/yourusername/playwright-demo.git
cd playwright-demo
npm install
To run tests on BrowserStack, copy the browserstack.example.yml
file to browserstack.yml
and add your BrowserStack details.
cp browserstack.example.yml browserstack.yml
# Edit browserstack.yml to add your BrowserStack credentials
To run tests locally:
npm run local-test
To run tests locally with the Playwright Test UI:
npm run local-ui-test
To run tests on BrowserStack:
npm run browserstack-test
This repository includes a GitHub Action that runs the tests both locally and on BrowserStack. The workflows are defined in the .github/workflows
folder.
If you wish to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
This project is licensed under the MIT License.