You can run the tests by using Maven commands:
-
Run all tests:
mvn test
-
Run tests with specific profiles:
-
Integration Tests:
mvn test -P integration-tests
-
End-to-End Tests:
mvn test -P e2e-tests
-
API Tests:
mvn test -P api-tests
There is a Bash script run-test.sh to run tests locally without Maven commands. To use the script:
-
Give it execution permission (if not already):
chmod +x src/main/java/com/playwright/practice/scripts/run-test.sh
-
Run the script:
./src/main/java/com/playwright/practice/scripts/run-test.sh [test-type]
Example:
./src/main/java/com/playwright/practice/scripts/run-test.sh i -h true -b c -t LoginTest
i
runs integration tests.-h
true runs tests in headless mode.-b
c runs tests in Chrome browser.-t
allows specifying a test class to run.