Ensure you have the following software installed on your machine:
- npm (v8.0.0 or later): Package manager for JavaScript, used to install and manage software packages.
- To verify your current version, use the command
npm -v
. - If npm isn't installed, follow the npm installation guide.
- To verify your current version, use the command
- Node.js (v16.0.0 or later): JavaScript runtime built on Chrome's V8 JavaScript engine, allowing the execution of JavaScript server-side.
- To verify your current version, use the command
node -v
.
- To verify your current version, use the command
- Git: Distributed version control system used to track changes in source code during software development.
- To check if Git is installed, run the command
git --version
. - If Git isn't installed, download and install it from the official Git website.
- To check if Git is installed, run the command
- VSCode Plugins:
- Prettier - Code formatter: A tool for consistent code formatting.
- ESLint: A tool for identifying and fixing linting issues.
- VSCode Settings: To ensure consistency with the prettier format settings, apply the following configurations in your VSCode settings (use Cmd + , to access settings):
- Quote Style: Set
typescript.preferences.quoteStyle
tosingle
for consistent quote usage across your code. - Format On Save: Enable
Format On Save Mode
and set it tofile
. This ensures your code is automatically formatted every time you save, enhancing readability and consistency.
- Quote Style: Set
- Clone the repository:
git clone https://github.com/vasu31dev/playwright-ts.git
- Navigate to the project directory:
cd playwright-ts
- Install the dependencies:
npm install
- Install the Playwright browsers
npx playwright install
-
(Optional) Git User setup for the first time. If you are a code/test contributor, set up your user in GIT using the commands:
git config user.email "<your-email>" git config user.name "<your-name>" git remote set-url origin https://USERNAME:[email protected]/vasu31dev/playwright-ts.git
Replace
<USERNAME>
with your GitHub username and<SECRETTOKEN>
with your GitHub personal access token. If you don't have a personal access token, you can create one in your GitHub account settings following this GitHub guide.
To pull the latest changes and install the latest packages, follow these steps:
- Pull the latest changes
git pull origin <branchName>
Replace <branchName>
with the name of the branch that you want to update.
- Install the latest packages
npm install
- If there are dependency errors while installing packages, you can remove the node_modules folder and install the packages again. This step can help resolve potential conflicts or issues with dependencies.
rm -rf node_modules
npm install
- Update Playwright browsers as needed
npx playwright install