<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Test Automation Pro on Medium]]></title>
        <description><![CDATA[Stories by Test Automation Pro on Medium]]></description>
        <link>https://medium.com/@info_70421?source=rss-88a48c480859------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OJvs8coCzEM4FGK4Fya9jQ.png</url>
            <title>Stories by Test Automation Pro on Medium</title>
            <link>https://medium.com/@info_70421?source=rss-88a48c480859------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:34:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@info_70421/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running Playwright Tests via Azure DevOps Pipeline]]></title>
            <link>https://medium.com/@info_70421/running-playwright-tests-via-azure-devops-pipeline-6b39e34e361b?source=rss-88a48c480859------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b39e34e361b</guid>
            <category><![CDATA[playwright-automation]]></category>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[yml]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Test Automation Pro]]></dc:creator>
            <pubDate>Tue, 09 Apr 2024 08:44:51 GMT</pubDate>
            <atom:updated>2026-10-26T18:44:07.406Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkEa6PWs74KYlCu3UA2IlQ.png" /></figure><p>Execute Playwright tests (hosted on GitHub) via Azure DevOps Pipeline. This guide will provide step-by-step instructions on setting up a GitHub repository, installing Playwright, configuring an Azure DevOps pipeline, and executing Playwright tests as part of a CI/CD workflow.</p><h4>Overview</h4><p>Playwright is a powerful tool for automating browser interactions, and Azure DevOps Pipelines provide a robust CI/CD platform for automating build, test, and deployment processes. By integrating Playwright tests into Azure DevOps Pipelines, teams can ensure that their web applications are thoroughly tested before deployment, reducing the risk of bugs and regressions reaching production.</p><h3>Prerequisites</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDllTx8gwp3vMN8UMfeAJQ.png" /></figure><p>Before you begin, ensure you have the following prerequisites:</p><ul><li><strong>GitHub account</strong>: You will need a GitHub account to create a new repository and push your Playwright project to it. If you don’t have a GitHub account, you can create one for free at <a href="https://github.com/">github.com</a>.</li><li><strong>Azure DevOps account</strong>: An Azure DevOps account is required to create and configure the CI/CD pipeline for your Playwright tests. If you don’t have an Azure DevOps account, you can sign up for one at <a href="https://dev.azure.com/">dev.azure.com</a>.</li><li><strong>Git</strong> installed on your local machine: Git is a version control system that is used to manage your code changes. If you haven’t installed Git yet, you can download it from <a href="https://git-scm.com/">git-scm.com</a>.</li><li><strong>Visual Studio Code</strong> (VS Code) installed on your local machine: VS Code is a lightweight but powerful source code editor. It is available for Windows, macOS, and Linux. You can download it from <a href="https://code.visualstudio.com/">code.visualstudio.com</a>.</li></ul><h3>Step 1: Create new GitHub Project</h3><ol><li>Login to GitHub, create a new GitHub project repository and clone it to your local machine.</li></ol><h3>Step 2: Add .gitignore file</h3><ol><li>On your local machine open the cloned GitHub repo in Visual Studio Code (VSCode).</li><li>Create a .gitignore file and add the following directories:</li></ol><pre>node_modules/<br>test-results/<br>tests-examples/<br>playwright-report/<br>playwright/.cache/</pre><h3>Step 3: Install Playwright</h3><ol><li>In the Terminal window in VSCode, install Playwright using the command:<br>npm init playwright@latest<br>during installation select your preferred language TypeScript or JavaScript (example in this guide are shown in JavaScript) and accept other prompts with default selections.</li><li>After the installation, Playwright generates example tests including a test file named tests/example.spec.js that contains two basic tests navigating to the Playwright Home Page URL and doing validations.</li><li>Run the tests with the command npx playwright test</li></ol><pre>// example.spec.js <br>const { test, expect } = require(&#39;@playwright/test&#39;);<br><br>test(&#39;has title&#39;, async ({ page }) =&gt; {<br><br>  await page.goto(&#39;https://playwright.dev/&#39;);<br><br>  // Expect a title &quot;to contain&quot; a substring.<br>  await expect(page).toHaveTitle(/Playwright/);<br>});<br><br>test(&#39;get started link&#39;, async ({ page }) =&gt; {<br>  await page.goto(&#39;https://playwright.dev/&#39;);<br>  // Click the get started link.<br><br>  await page.getByRole(&#39;link&#39;, { name: &#39;Get started&#39; }).click();<br><br>  // Expects page to have a heading with the name of Installation.<br>  await expect(page.getByRole(&#39;heading&#39;, { name: &#39;Installation&#39; })).toBeVisible();<br>});</pre><h3>Step 4: Update the Playwright Config file</h3><ol><li>Open the playwright.config.js file in VSCode and add the following:</li></ol><pre>// @ts-check<br>const { defineConfig, devices } = require(&#39;@playwright/test&#39;);<br><br>/**<br> * @see https://playwright.dev/docs/test-configuration<br> */<br>module.exports = defineConfig({<br>  testDir: &#39;./tests&#39;,<br>  /* Run tests in files in parallel */<br>  fullyParallel: true,<br>  /* Fail the build on CI if you accidentally left test.only in the source code. */<br>  forbidOnly: !!process.env.CI,<br>  /* Retry on CI only */<br>  retries: process.env.CI ? 2 : 0,<br>  /* Opt out of parallel tests on CI. */<br>  workers: process.env.CI ? 1 : undefined,<br><br>  /* Reporter to use. See https://playwright.dev/docs/test-reporters <br>  Set to:&#39;never&#39;, change to &#39;always&#39; to launch report automatically after execution */<br>  reporter: [ <br>    [&#39;html&#39;, { open: &#39;never&#39; }],<br>    [&#39;junit&#39;, {outputFile: &#39;results.xml&#39;}] //required for Azure DevOps Pipeline<br>  ],<br>  <br><br>  use: {<br>    /* Maximum time each action such as `click()` can take. <br>        Defaults to 0 (no limit). */<br>    actionTimeout: 60 * 1000,<br>    navigationTimeout: 30 * 1000,<br><br>    /* Collect trace when retrying the failed test. <br>    See https://playwright.dev/docs/trace-viewer */<br>    trace: &#39;on&#39;,<br>    screenshot: &#39;only-on-failure&#39;,<br>    video: {<br>      mode: &#39;on&#39;<br>    },<br>    headless: true,<br>    viewport: { width: 1900, height: 940 },<br>    launchOptions: {<br>        slowMo: 500,<br>    },<br>  },<br>  <br>  /* Configure projects for major browsers */<br>  projects: [<br>    {<br>      name: &#39;chromium&#39;,<br>      use: { ...devices[&#39;Desktop Chrome&#39;] },<br>    },<br><br>    {<br>      name: &#39;firefox&#39;,<br>      use: { ...devices[&#39;Desktop Firefox&#39;] },<br>    },<br><br>    {<br>      name: &#39;webkit&#39;,<br>      use: { ...devices[&#39;Desktop Safari&#39;] },<br>    },<br><br>  ],<br><br>});</pre><h3>Step 5: Run Playwright Tests</h3><ol><li>Run Playwright test using npx playwright test command</li><li>Optionally update package.json file with the following to run Playwright tests with the shortened test execution command npm test</li></ol><pre>&quot;scripts&quot;: {<br>    &quot;test&quot;: &quot;npx playwright test --workers=1&quot;<br>  },</pre><h3>Step 6: Push updated Project to GitHub</h3><ol><li>After executing your tests and confirming the tests run successfully push your repo to GitHub.</li><li>Push all he updates to the project we’ve done so far to GitHub:<br>git add .<br>git commit -m &quot;Add Playwright Tests&quot;<br>git push</li></ol><p>At this point our project files are pushed to remote repository but we don’t yet have a pipeline that would execute the tests we just uploaded.</p><p>Next we’re going to configure Azure DevOps project and create the pipeline to run the tests via Azure DevOps.</p><h3>Step 7: Creating Azure DevOps Organization and Project</h3><ol><li><strong>Create a new Azure DevOps organization:</strong></li></ol><ul><li>Go to <a href="https://dev.azure.com/">dev.azure.com</a> and sign in with your Azure DevOps account.</li><li>Click on your profile icon in the top right corner and select “Organizations.”</li><li>Click on the “New organization” link.</li><li>Enter a name for your organization and follow the prompts to create it.</li></ul><p><strong>2. Create a new project in the organization:</strong></p><ul><li>Once you’ve created the organization, click on the “New project” button on the organization’s home page.</li><li>Enter a name for your project, select the visibility (private), and choose a version control system (Git).</li><li>Click “Create” to create the project.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YyHSH6RFyqwqjeP_HWqZ3g.png" /></figure><p>3. Select your new project and navigate to Pipelines</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQVUm_2qmYaYpR74Y9JT_A.png" /></figure><h3>Step 8: Creating pipeline YML files</h3><p>Before we can create a pipeline in Azure DevOps, we need to add YAML files to our GitHub Playwright project and create instructions for running the pipeline. We are going to add two files: playwright-template.yml and playwright-automation.yml. Here&#39;s how you can do it:</p><h3>Adding YAML Files for Azure DevOps CI/CD Pipeline</h3><p>Create a azure-pipelines directory in your Playwright project:</p><ul><li>In your Visual Studio Code editor, navigate to the root of your Playwright project.</li><li>Create a new directory named azure-pipelines.</li></ul><p>Add playwright-template.yml and playwright-automation.yml files inside the azure-pipelines directory:</p><p>Edit the playwright-template.yml file:</p><ul><li>Open the playwright-template.yml file in Visual Studio Code.</li><li>Add the the following YAML code to define the template for your Playwright tests. This file will contain the common steps and configurations that will be reused across different test scenarios.</li><li>This pipeline is designed to run Playwright tests in an Azure DevOps pipeline.</li><li>It defines a parameter BASE_URL that allows you to specify the base URL for your tests.</li><li>The pipeline consists of a single job named test that contains several steps:</li></ul><ol><li>Use Node version 16: Sets the Node version to 16.x for the pipeline.</li><li>NPM Install: Installs the project dependencies using npm ci.</li><li>Playwright Install: Installs Playwright and its dependencies.</li><li>Run Playwright Tests: Sets the BASE_URL parameter, configures Playwright to run in CI mode, specifies the output format for JUnit, and runs the Playwright tests. This step continues even if there are errors (continueOnError: true).</li><li>Add playwright-report to Archive: Archives the playwright-report folder to a zip file.</li><li>Add test-results to Archive: Archives the test-results folder to a zip file.</li><li>Publish Pipeline Artifacts: Publishes the archived files as pipeline artifacts.</li><li>Publish Test Results: Publishes the test results in JUnit format with the title “Playwright ADO Demo — $(System.StageName)”.</li></ol><pre>parameters:<br>  - name: BASE_URL<br>    type: string<br><br>jobs:<br><br>  - job: test<br>    displayName: Run Playwright Tests<br>    steps:<br><br>      - download: none<br>      <br>      - checkout: self<br><br>      - task: NodeTool@0<br>        displayName: &#39;Use Node version 16&#39;<br>        inputs:<br>          versionSpec: 16.x<br><br>      - script: |<br>          npm ci<br>        displayName: &quot;NPM Install&quot;<br><br>      - script: |<br>          npx playwright install --with-deps<br>        displayName: &quot;Playwright Install&quot;<br><br>      - script: |<br>          set BASE_URL=${{ parameters.BASE_URL }}<br>          set CI=true<br>          set PLAYWRIGHT_JUNIT_OUTPUT_NAME=results.xml<br>          npx playwright test<br>        displayName: &quot;Run Playwright Tests&quot;<br>        continueOnError: true<br><br>      - task: ArchiveFiles@2<br>        displayName: &#39;Add playwright-report to Archive&#39;<br>        inputs:<br>          rootFolderOrFile: &#39;$(Pipeline.Workspace)/s/playwright-report/&#39;<br>          archiveFile: &#39;$(Agent.TempDirectory)/$(Build.BuildId)_$(System.JobAttempt)$(System.StageAttempt).zip&#39;<br><br>      - task: ArchiveFiles@2<br>        displayName: &#39;Add test-results to Archive&#39;<br>        inputs:<br>          rootFolderOrFile: &#39;$(Pipeline.Workspace)/s/test-results/&#39;<br>          archiveFile: &#39;$(Agent.TempDirectory)/$(Build.BuildId)_$(System.JobAttempt)$(System.StageAttempt).zip&#39;<br>          replaceExistingArchive: false<br><br>      - task: PublishPipelineArtifact@1<br>        displayName: &#39;Publish Pipeline Artifacts&#39;<br>        inputs:<br>          targetPath: &#39;$(Agent.TempDirectory)/$(Build.BuildId)_$(System.JobAttempt)$(System.StageAttempt).zip&#39;<br>          artifact: pipeline-artifacts<br><br>      - task: PublishTestResults@2<br>        inputs:<br>          testResultsFormat: &#39;JUnit&#39;<br>          testResultsFiles: &#39;$(Pipeline.Workspace)/s/results.xml&#39;<br>          testRunTitle: &#39;Playwright ADO Demo - $(System.StageName)&#39;<br>        displayName: &#39;Publish Test Results&#39;</pre><p>Edit the playwright-automation.yml file:</p><ul><li>Open the playwright-automation.yml file in Visual Studio Code.</li><li>Add the necessary YAML code to define the pipeline for running your Playwright tests. This file will include steps to install dependencies, build the project, and run the Playwright tests.</li></ul><pre>pool:<br>  vmImage: &#39;windows-latest&#39;<br><br>trigger:<br>  branches:<br>    include:<br>      - &#39;main&#39;<br><br>name: $(Build.BuildId)<br><br>stages:<br><br>  - stage: qa<br>    displayName: &#39;Run Automation Test - QA&#39;<br>    dependsOn: []<br>    jobs:<br>      - template: playwright-template.yml<br>        parameters:<br>          BASE_URL: &#39;&#39;</pre><h3>Creating a Pipeline in Azure DevOps</h3><p>Now we can create a new pipeline in Azure DevOps, select a Git repository, and choose the existing YAML files option:</p><p><strong>Sign in to Azure DevOps</strong>:</p><ul><li>Go to <a href="https://dev.azure.com/">dev.azure.com</a> and sign in with your Azure DevOps account.</li></ul><p><strong>Navigate to your project</strong>:</p><ul><li>Select the organization and project where you want to create the pipeline.</li></ul><p><strong>Create a new pipeline</strong>:</p><ul><li>Click on “Pipelines” in the left sidebar.</li><li>Click on the “Create Pipeline” button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQVUm_2qmYaYpR74Y9JT_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_jSKPtBJjP9k4hWncm5Wg.png" /></figure><p><strong>Select your repository</strong>:</p><ul><li>In Where is your code?’ screen select GitHub (YAML) option</li><li>Choose the Git repository where your Playwright project is located.</li><li>If you haven’t connected your repository yet, click on “Connect” and follow the prompts to connect to your Git repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eOUYWUaKU03sgI2T82KSsQ.png" /></figure><p><strong>Configure your pipeline:</strong></p><ul><li>In the “Configure your pipeline” step, select “Existing Azure Pipelines YAML file” as the pipeline configuration method.</li><li>Click on the “YAML file path” field and select the playwright-automation.yml file from the azure-pipelines directory in your repository.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41rj6oex-DSa10FYAQozjg.png" /></figure><ul><li>Click “Continue” to proceed.</li><li>Review the pipeline configuration to ensure it matches your requirements.</li><li>Click on “Run” to save the pipeline configuration and run the pipeline.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbXUmUZhaoj4oGBQQ50iqA.png" /></figure><p><strong>Monitor the pipeline execution</strong>:</p><ul><li>Once the pipeline is running, you can monitor its progress in the Azure DevOps interface.</li><li>The pipeline will automatically run the tasks defined in your playwright-automation.yml file, such as installing dependencies, building the project, and running the Playwright tests.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9YitjTM3CkOsC07RVFGKw.png" /></figure><p><strong>View the results</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lcghv5c8VLVHKmpTTBN7cg.png" /></figure><ul><li>After the pipeline has completed, you can view the results of the Playwright tests in the Azure DevOps interface.</li><li>Any test failures or other issues will be reported in the pipeline logs.</li><li>You can download execution results including traces, video files, screenshots, etc and view them on your local machine</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GAI3CQdhyMFLUwh6vszrZA.png" /></figure><ul><li>NOTE: Your Playwright tests are now set up to run automatically in Azure DevOps whenever you push changes to your Git repository.</li></ul><h3>Adding Pipeline Parameters</h3><p>Adding pipeline parameters in Azure DevOps can be beneficial for several reasons.</p><ul><li>It allows for greater flexibility and reusability of pipelines.</li><li>By defining parameters, you can customize the behavior of your pipeline based on different scenarios, such as deploying to different environments or running different sets of tests.</li><li>This flexibility reduces the need to create multiple similar pipelines, simplifying your pipeline configuration and maintenance.</li></ul><p>To add a pipeline parameters to our example we going to modify project files as follows:</p><ol><li>Update Playwright tests in <strong>example.spec.js</strong> to use a global variable for website URL. Optionally, add a log statement to see how the global variable value is used in the test.</li></ol><pre>// @ts-check<br>const { test, expect } = require(&#39;@playwright/test&#39;);<br><br>test(&#39;has title&#39;, async ({ page }) =&gt; {<br>  await page.goto(global.BASE_URL);<br><br>  console.log(&#39;Test 1 [has title] : Global BASE_URL variable: &#39;, global.BASE_URL)<br><br>  // Expect a title &quot;to contain&quot; a substring.<br>  await expect(page).toHaveTitle(/Playwright/);<br>});<br><br>test(&#39;get started link&#39;, async ({ page }) =&gt; {<br>  await page.goto(global.BASE_URL);<br><br>  console.log(&#39;Test 2 [get started link]: Global BASE_URL variable: &#39;, global.BASE_URL)<br><br>  // Click the get started link.<br>  await page.getByRole(&#39;link&#39;, { name: &#39;Get started&#39; }).click();<br><br>  // Expects page to have a heading with the name of Installation.<br>  await expect(page.getByRole(&#39;heading&#39;, { name: &#39;Installation&#39; })).toBeVisible();<br>});<br></pre><p>2. Update <strong>playwright.config.js</strong> to reference global variable</p><pre>const { defineConfig, devices } = require(&#39;@playwright/test&#39;);<br><br>Object.assign(global, {<br>  BASE_URL: process.env.BASE_URL,<br>});<br><br>//... the rest of the playwright.config.js file</pre><p>3. Update <strong>playwright-automation.yml</strong> with the BASE_URL value:</p><pre>pool:<br>  vmImage: &#39;windows-latest&#39;<br><br>trigger:<br>  branches:<br>    include:<br>      - &#39;main&#39;<br><br>name: $(Build.BuildId)<br><br>stages:<br><br>  - stage: qa<br>    displayName: &#39;Run Automation Test - QA&#39;<br>    dependsOn: []<br>    jobs:<br>      - template: playwright-template.yml<br>        parameters:<br>          BASE_URL: &#39;https://playwright.dev/&#39;</pre><p>4. Confirm <strong>playwright-template.yml</strong> file has BASE_URL parameter referenced as follows:</p><pre>parameters:<br>  - name: BASE_URL<br><br>...<br><br>- script: |<br>          set BASE_URL=${{ parameters.BASE_URL }}<br><br>...</pre><p>5. Push your updates to GitHub which will trigger automatic pipeline execution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_dWFvFeFZ9Ip-DyZfBI_Q.png" /></figure><p>6. View Execution Results</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WNAtvnpXIswN9Mv_P_X2Eg.png" /></figure><h3>Parting words</h3><p>🎉This is it! Congratulations on successfully setting up the Azure DevOps pipeline for executing Playwright scripts. This basic example serves as a foundation that you can expand further to meet your specific testing needs.</p><p>🛠️ Consider adding additional steps for environment setup, parallel test execution, or integration with other tools to enhance your pipeline and optimize your testing process.</p><p>🔍 Keep exploring and refining your pipeline to make the most out of Azure DevOps and Playwright.</p><p>👏 Great job, and happy testing! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b39e34e361b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Playwright Tests via GitLab CI/CD Pipeline]]></title>
            <link>https://medium.com/@info_70421/running-playwright-tests-via-gitlab-ci-cd-pipeline-572e1d95f6f2?source=rss-88a48c480859------2</link>
            <guid isPermaLink="false">https://medium.com/p/572e1d95f6f2</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[playwright-test]]></category>
            <category><![CDATA[gitlab-artifacts]]></category>
            <category><![CDATA[gitlab-ci]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Test Automation Pro]]></dc:creator>
            <pubDate>Fri, 10 Nov 2023 08:43:55 GMT</pubDate>
            <atom:updated>2026-10-26T18:52:17.203Z</atom:updated>
            <content:encoded><![CDATA[<h3>Run Playwright Tests via GitLab CI/CD Pipeline using project-level variables, saving results to artifacts.</h3><p>Execute Playwright Tests via GitLab CI/CD Pipeline. Use project-level variables, save execution results to artifacts and view results via GitLab pages.</p><p>In this project we will create and clone a GitLab repository, install Playwright and generating basic tests and run Playwright tests via GitLab CI/CD pipeline.</p><p>We will use GitLab project-level variables and publish Playwright test results as pipeline artefacts viewable via GitLab pages.</p><p>Let’s go!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BhVj7-UkGgq7XKhhrqPHZQ.png" /></figure><h3>Step 1: Create new GitLab Project</h3><ol><li>GitLab: Create a new GitLab project repository and clone it to your local machine.</li></ol><h3>Step 2: Install Playwright</h3><ol><li>On your local machine open the cloned GitLab repo in Visual Studio Code (VSCode).</li><li>Create a .gitignore file and add the following directories:</li></ol><pre>node_modules/<br>test-results/<br>tests-examples/<br>playwright-report/<br>playwright/.cache/<br></pre><h3>Step 3: Install Playwright</h3><ol><li>In the Terminal window in VSCode, install Playwright using the command:<br>npm init playwright@latest<br>during installation select your preferred language TypeScript or JavaScript (example in this guide are shown in JavaScript) and accept other prompts with default selections.</li><li>After the installation, Playwright generates example tests including a test file named tests/example.spec.js that contains two basic tests navigating to the Playwright Home Page URL and doing validations.</li><li>Run the tests with the command npx playwright test</li></ol><pre>// example.spec.js <br><br>const { test, expect } = require(&#39;@playwright/test&#39;);<br><br>test(&#39;has title&#39;, async ({ page }) =&gt; {<br>  await page.goto(&#39;https://playwright.dev/&#39;);<br>  // Expect a title &quot;to contain&quot; a substring.<br>  await expect(page).toHaveTitle(/Playwright/);<br>});<br><br>test(&#39;get started link&#39;, async ({ page }) =&gt; {<br>  await page.goto(&#39;https://playwright.dev/&#39;);<br>  // Click the get started link.<br>  await page.getByRole(&#39;link&#39;, { name: &#39;Get started&#39; }).click();<br>  // Expects page to have a heading with the name of Installation.<br>  await expect(page.getByRole(&#39;heading&#39;, { name: &#39;Installation&#39; })).toBeVisible();<br>});</pre><h3>Step 4: Update the Playwright Config</h3><p>First we’re going to replace hardcoded URL in our code with a reference to a global variable we will create in the Playwright Config file.</p><ol><li>Open the playwright.config.js file in VSCode and add the following</li></ol><pre>Object.assign(global, {<br>  BASE_URL: &#39;https://playwright.dev/&#39;,<br>});</pre><p>2. Optionally add this to playwright.config.js to always capture trace and generate video of the execution</p><pre>  use: {<br>    trace: &quot;on&quot; /* Collect trace always. See https://playwright.dev/docs/trace-viewer */,<br>    video: &quot;on&quot; /* Record Video */,<br>    screenshot: &quot;only-on-failure&quot;,<br>    headless: true,<br>    viewport: { width: 1900, height: 940 },<br>    launchOptions: {<br>      slowMo: 500,<br>    },<br>  },</pre><h3>Step 5: Update the Playwright Test</h3><ol><li>Open the example.spec.js file in VSCode.</li><li>Replace the hardcoded URL <a href="https://playwright.dev/">https://playwright.dev/</a> with global.BASE_URL. This allows the test to navigate to the URL defined in the globalBASE_URL variable in Playwright Config.</li><li>Here’s modified example.spec.js file</li><li>Run the tests with the command npx playwright test to confirm the update.</li></ol><pre>// example.spec.js <br><br>const { test, expect } = require(&#39;@playwright/test&#39;);<br><br>test(&#39;has title&#39;, async ({ page }) =&gt; {<br><br>  await page.goto(global.BASE_URL);<br><br>  // Expect a title &quot;to contain&quot; a substring.<br>  await expect(page).toHaveTitle(/Playwright/);<br>});<br><br>test(&#39;get started link&#39;, async ({ page }) =&gt; {<br><br>  await page.goto(global.BASE_URL);<br><br>  // Click the get started link.<br>  await page.getByRole(&#39;link&#39;, { name: &#39;Get started&#39; }).click();<br><br>  // Expects page to have a heading with the name of Installation.<br>  await expect(page.getByRole(&#39;heading&#39;, { name: &#39;Installation&#39; })).toBeVisible();<br>});</pre><h3>Step 6: Push updated Project to GitLab</h3><ol><li>Push all he updates to the project we’ve done so far to GitLab:<br>git add .<br>git commit -m &quot;Add Playwright Tests&quot;<br>git push</li></ol><p>At this point our project files are pushed to remote repository but we don’t yet have a pipeline that would execute the tests we just uploaded.</p><p>Next we’re going to configure the pipeline to run the tests and publish the results and create a global variable for BASE_URL in GitLab project settings.</p><h3>Step 7: Define a Project Level Variable in GitLab</h3><ol><li>Go to your remote project’s Settings in GitLab.</li><li>Navigate to Settings &gt; CI/CD section.</li><li>Expand the Variables section.</li><li>Click on “Add Variable”.</li><li>In the Key field, enter BASE_URL.</li><li>In the Value field, enter the URL, i.e. <a href="https://playwright.dev/">https://playwright.dev/</a></li><li>Click on “Add Variable” to save it.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0GMEyaAMIdvNvsra6lgCg.png" /></figure><h3>Step 8: Run the Test via GitLab CI/CD Pipeline</h3><ol><li>In VSCode, create a .gitlab-ci.yml file in your local project root.</li><li>Define a job that runs the Playwright test and publishes run results folder playwright-report as artifacts with 2 days expiration period.</li><li>We are also adding a shortcut link to view execution results (saves 4 clicks) right from pipeline execution log.</li></ol><pre># Variables<br>variables:<br>  BASE_URL: $BASE_URL # variable defined in GitLab Project CI/CD Settings<br><br># Define the stages for your pipeline<br>stages:<br>  - test<br><br># Define the job for running Playwright tests<br>run_playwright_tests:<br>  stage: test<br>  image: mcr.microsoft.com/playwright:v1.39.0-jammy<br>  script:<br>    - npm ci # Install project dependencies<br>    - npx playwright test # Run your Playwright tests <br>    - echo &quot;https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/playwright-report/index.html&quot; # print the URL to view the results<br>  allow_failure: true<br><br>  # Publish Playwright test results as artifacts and keep for 2 days<br>artifacts:<br>  when: always<br>  paths:<br>    - playwright-report<br>  expire_in: 2 days</pre><p>Update Playwright Config file to reference a GitLab project variable</p><pre>Object.assign(global, {<br>  BASE_URL: process.env.BASE_URL,<br>});</pre><p>Commit and push the .gitlab-ci.yml file to the remote repo in GitLab with the commands:</p><pre>git add .<br>git commit -m &quot;Add GitLab CI/CD configuration&quot;<br>git push</pre><p>The pipeline should start automatically in the remote project in GitLab and run your test.</p><p>View the results of the pipeline execution in Build &gt; Jobs menu</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*Ock-CCtnfFAMlMvjK4wM5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*LKm9OWgbX7FjiOORij1r6g.png" /></figure><p>Now your pipeline in GitLab runs the automated script which takes the BASE_URL variable value from the project settings. This setup allows you to easily change the test URL without modifying the test script as well as adding other project level variables such as usernames and passwords</p><p>View result by clicking the link from the pipeline execution log:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xbay3BFeAj8y42kfoxJ1ag.png" /><figcaption>Pipeline Job run log</figcaption></figure><p>Happy GitLab CI/CD testing! 🚀</p><h3>Parting Notes</h3><ol><li>Now that your local project is updated to use the BASE_URL variable from GitLab project setting how can you still run your tests locally? One way is to create a local System Environment variable BASE_URL and populate its value and you’ll still be able to run your tests locally.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*z_2Q5IfmRnQT9UKhnjUYfA.png" /></figure><p>2. Shorten the test execution command to npm test instead of npx playwright test. Update the scripts section in package.json to run the scripts with the following:</p><pre> &quot;scripts&quot;: {<br>    &quot;test&quot;: &quot;npx playwright test --workers=1&quot;<br>  },</pre><h3>Clone this project to try it out</h3><p>This project can be found on GitLab at:</p><p><a href="https://gitlab.com/qaa_demo/gitlab-playwright-demo/">qaa_demo / gitlab-playwright-demo · GitLab</a></p><h3>Resources and References</h3><ol><li>Playwright Documentation for GitLab CI <a href="https://playwright.dev/docs/ci#gitlab-ci">https://playwright.dev/docs/ci#gitlab-ci</a></li><li>GitLab Playwright automation templates: <a href="https://gitlab.com/automation4175606/playwright-tests">https://gitlab.com/automation4175606/playwright-tests</a></li><li>Playwright and Gitlab CI: how to run your E2E tests: <a href="https://medium.com/@jeremie.fleurant/playwright-and-gitlab-ci-how-to-run-your-e2e-tests-42a51fd3e54e">https://medium.com/@jeremie.fleurant/playwright-and-gitlab-ci-how-to-run-your-e2e-tests-42a51fd3e54e</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=572e1d95f6f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lean Automation Frameworks: Transforming QA with Proven Startup Techniques]]></title>
            <link>https://medium.com/@info_70421/lean-automation-frameworks-transforming-qa-with-proven-startup-techniques-0bf3d9798b11?source=rss-88a48c480859------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bf3d9798b11</guid>
            <category><![CDATA[lean-startup-method]]></category>
            <category><![CDATA[qa-testing]]></category>
            <category><![CDATA[qa-automation]]></category>
            <category><![CDATA[lean-startup]]></category>
            <category><![CDATA[qa-test-automation]]></category>
            <dc:creator><![CDATA[Test Automation Pro]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 18:39:21 GMT</pubDate>
            <atom:updated>2023-10-24T18:39:21.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*aqGQGZCwq7cGGLXSMdNPaA.png" /></figure><p>Eric Ries’ book “<a href="https://amzn.to/3rUi6L1">The Lean Startup</a>” was written primarily for entrepreneurs looking to transform the way businesses are launched and expanded. However, the concepts in this book may have a much broader application, including QA Automation.</p><p>While the book’s primary focus is on building successful companies, it contains a wealth of techniques and strategies that can be highly beneficial when applied to building robust Test Automation frameworks.</p><p>By drawing parallels between start up building strategies and QA Automation Frameworks, we uncover a world where <em>rapid iteration,</em> <em>validated learning</em>, and a keen sense of <em>adaptability </em>align perfectly with the dynamic needs of software quality assurance.</p><p>Learn more about the principles in this “<a href="https://medium.com/@info_70421/the-lean-startup-starting-your-start-up-right-for-entrepreneurial-success-0fce7511e542">The Lean Startup” summary.</a></p><h3>1. The Build-Measure-Learn Feedback Loop</h3><p>Just as in a Lean Startup, building a QA Automation framework <strong>shouldn’t aim to create a comprehensive system from the start</strong>. Instead, focus on essential components, such as selecting the right automation tools, test libraries, and designing a flexible framework structure. Measure the framework’s adaptability by running a core set of test cases. Learn from this initial implementation and be prepared to adjust the framework to meet evolving testing requirements.</p><h3>2. Validated Learning</h3><p>In QA Automation, validated learning means using real-world test scenarios to inform framework decisions. This involves analyzing the framework’s ability to adapt to different testing needs, from functional to regression testing, and learning from the outcomes. Validate your framework’s design by seeking feedback from QA engineers and incorporating their insights to enhance the framework’s usability.</p><h3>3. Minimum Viable Product (MVP)</h3><p>When building an MVP for a QA Automation framework, consider starting with a basic framework that execute a limited set of test cases effectively. This MVP should include core features like test script execution, result reporting, integration with version control and CI/CD pipelines. Gradually expand the framework by incorporating more advanced features as the project evolves and specific testing needs arise.</p><h3>4. Pivot or Persevere</h3><p>Being open to pivoting or persevering in framework development is crucial. For instance, if you notice that a particular framework component is causing bottlenecks or hampering adaptability, be willing to pivot by refactoring the code or retiring outdated components. This refactoring and component retirement process should be considered a normal part of framework evolution, not something to fear or avoid.</p><h3>5. The Three Engines of Growth</h3><p>In the context of building a QA Automation framework, the three engines of growth could relate to increasing its capabilities, improving its adaptability to different testing scenarios, and enhancing its scalability to handle larger test suites and evolving applications.</p><h3>6. Innovative Accounting</h3><p>Innovative accounting for QA Automation involves continuously assessing the r<strong>eturn on investment (ROI) for automation efforts</strong>. It includes quantifying the cost savings, efficiency gains, and quality improvements achieved through the automation framework. Using innovative metrics can help measure the framework’s effectiveness.</p><h3>7. The Lean Startup in Established Companies</h3><p>Even established QA processes can benefit from lean startup thinking when building an automation framework. The established QA team can adopt agile, iterative approaches in framework development and incorporate feedback loops to ensure that the framework aligns with changing testing requirements.</p><h3>8. Continuous Deployment and Split Testing</h3><p>Continuous deployment in QA Automation framework development aligns with integrating new components and capabilities incrementally as the framework evolves. Split testing can be applied to compare different framework structures and testing methodologies to identify the most efficient and effective approaches for automated testing.</p><h3>9. The Lean Startup Toolbox</h3><p>The Lean Startup Toolbox can be translated into a toolkit for building a QA Automation framework. This toolbox includes various automation tools, testing libraries, and framework structures. It evolves continuously to adapt to the changing needs of software testing and to ensure that the framework remains efficient and effective.</p><h3>Parting Words</h3><p>By connecting these key sections of “The Lean Startup” with insights for building a QA Automation framework, organizations can apply lean startup principles to construct and evolve automation frameworks that are adaptable, efficient, and responsive to the dynamic needs of their QA Automaton processes.</p><p>🟠<a href="https://amzn.to/45OG7AJ">Listen the full version of “The Lean Startup” book on Audible</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bf3d9798b11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Lean Startup: Starting Your ‘Start-up’ Right for Entrepreneurial Success]]></title>
            <link>https://medium.com/@info_70421/the-lean-startup-starting-your-start-up-right-for-entrepreneurial-success-0fce7511e542?source=rss-88a48c480859------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fce7511e542</guid>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[innovation-management]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[successful-entrepreneurs]]></category>
            <dc:creator><![CDATA[Test Automation Pro]]></dc:creator>
            <pubDate>Sun, 22 Oct 2023 09:12:37 GMT</pubDate>
            <atom:updated>2023-10-23T23:19:37.795Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*PiDV4yruoERWbQwKtwWlBw.png" /><figcaption>“The Lean Startup” by Eric Ries</figcaption></figure><p>“<a href="https://amzn.to/3rUi6L1">The Lean Startup</a>” is introduced by Eric Ries by drawing attention to the conventional method of launching a company, which typically entails drafting a thorough business plan, obtaining capital, and carrying out the plan. He contends that this strategy is faulty because it is predicated on the idea that we can foresee the future with accuracy and that there won’t be any major adjustments required along the way.</p><p>Ries highlights the significant failure rate of startups resulting from this technique and offers a different approach based on agile development and lean manufacturing. The lean startup methodology is centred on rapidly verifying concepts, reducing waste, and iteratively adjusting to new knowledge.</p><h3>The Build-Measure-Learn Feedback Loop</h3><p>A key component of lean startup technique is the feedback cycle of <strong>Build-Measure-Learn</strong>. In order to make educated judgments, this method entails developing a minimum viable product (MVP), assessing its performance, and gathering feedback and data. Iteratively repeating this loop enables the startup to improve both its product and its comprehension of the market.</p><p>· <strong>Build</strong>: Begin with a minimal, workable version of your product that fulfills the essential requirements of your intended market. The objective is to produce something rapidly and affordably.</p><p>· <strong>Measure</strong>: Gather information on how users engage with the product. Actionable metrics, also known as key metrics, assist you in evaluating the effectiveness of the product and how it affects consumer behaviour.</p><p>· <strong>Learn</strong>: To obtain knowledge and make wise judgments, use the data and customer feedback. Based on what you’ve learned, be prepared to pivot (make substantial changes) or endure (keep going in the same direction).</p><h3>Validated Learning</h3><p><strong>Validated learning</strong> is the main goal of the lean startup methodology. Acquiring tangible, usable knowledge that enables you to make well-informed decisions regarding your organization and product is known as validated learning. It’s about figuring out as soon as possible what works and what doesn’t.</p><h3>Minimum Viable Product (MVP)</h3><p>A key idea in the lean startup methodology is the MVP. The most basic iteration of your product that lets you collect data and test your ideas is called an MVP. Building just enough to learn and iterate is more important than building everything you have in mind. This strategy aids in resource conservation and prevents excessive investment in novel concepts.</p><h3>Pivot or Persevere</h3><p>Making a significant shift in your product, approach, or course based on customer feedback and lessons learned from your MVP is known as pivoting. When the information indicates that you are moving in the right direction, perseverance means staying on your current course. One of the most important skills in lean startup thinking is knowing when to give up and when to keep trying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hngj4c9g1-YYPeEnKtwWbw.jpeg" /></figure><h3>Build-Measure-Learn in Practice</h3><p>Ries provides a plethora of real-world examples to illustrate the operation of the Build-Measure-Learn loop. He talks about how businesses like Zappos, IMVU, and Dropbox used these ideas to build their products and adapt to customer feedback.</p><h3>The Three Engines of Growth</h3><p>Ries presents the idea of the three growth engines:</p><p>· <strong>The Sticky Engine</strong>: is a customer retention tool that strives to create a compelling enough product to keep users coming back.</p><p>· <strong>The Viral Engine</strong>: This engine uses word-of-mouth advertising and customer recommendations to propel expansion.</p><p>· <strong>The Paid Engine</strong>: To attract new clients, this engine uses conventional paid marketing and advertising.</p><p>Ries highlights that before attempting to scale their business, startups must select and become proficient in one of these engines.</p><h3>Innovative Accounting</h3><p>In the traditional accounting sense, startups often appear to be failures because they operate at a loss. Ries introduces the concept of “innovative accounting” to evaluate the success of a startup based on <strong>validated learning and progress</strong>, rather than financial metrics alone. By focusing on actionable metrics, startups can better assess their growth and potential.</p><h3>The Lean Startup in Established Companies</h3><p>While the lean startup methodology is often associated with new ventures, Ries also discusses how established companies can benefit from these principles. Large organizations can adopt lean startup techniques to foster innovation, test new products, and remain competitive in rapidly changing markets.</p><h3>Obstacles to Lean Startup Thinking</h3><p>According to Ries, a culture of risk aversion, an emphasis on vanity metrics (metrics that appear impressive but don’t offer actionable insights), and a fear of learning that goes against preconceived notions are some of the barriers that can prevent the adoption of lean startup principles.</p><h3>Continuous Deployment and Split Testing</h3><p>Ries promotes split testing and continuous feature deployment to enable quick iterations. Continuous deployment is the practice of releasing updates and new features as soon as they’re prepared, as opposed to releasing them in big, irregular chunks. Split testing is presenting various iterations of a product to distinct user groups in order to determine which iteration performs better.</p><h3>The Lean Startup Toolbox</h3><p>Ries offers a useful toolkit of methods and approaches that business owners can use to successfully apply the concepts of lean startup. This covers methods for measuring actionable metrics, interviewing customers, and creating MVPs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmlFAv_ktAc0ct-19w_dAA.jpeg" /></figure><h3>Final Thoughts</h3><p>Eric Ries’ groundbreaking book “<a href="https://amzn.to/3rUi6L1">The Lean Startup</a>” has revolutionized the way entrepreneurs approach innovation and startups. Numerous startups have found success thanks to its focus on iterative development, validated learning, and effective resource utilization. In a world that is constantly changing, entrepreneurs can improve their chances of creating profitable and long-lasting businesses by embracing the lean startup methodology.</p><p><a href="https://amzn.to/45OG7AJ">Get “The Lean Startup” Audio Book for free with this Audible offer.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fce7511e542" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>