Code Monkey home page Code Monkey logo

onboarding-e2e-tests's Introduction

onboarding-e2e-tests

Helpful links

Item Link
Getting Help This nerdlet is owned by the Virtuoso team
Slack: #help-virtuoso
Page ๐Ÿšจ: 911 teamstore VIRTUOSO

About

This is the Virtuoso package responsible for:

  • Playwright E2E testing for Guided installation

Contributing Guidelines

  1. Fork the repo.
  2. Create a branch request.
  3. Implement the change.
  4. Verify your tests and all existing tests pass.
  5. Open a pull request.
  6. Bring the pull request to the attention of the @hero in #help-virtuoso

Github Actions

Github Woklfow is configured to trigger the tests on a push/PR to main branch. Workflow will create an Ubuntu GH container, install the dependencies, run all the tests in e2e/tests folder and upload the test results artifact which can be downloaded.

Schedule

Currently scheduled to run once every 60 minuites. Schedule can be edited in github/workflows/manual.yml file

Running E2E tests in local

Set up

  1. Clone the repo

  2. Install the correct Node version: nvm install

  3. Install dependencies: npm install

  4. To test local nerdpack, in playwright.config.js file update the baseURL to https://dev-one.newrelic.com/?nerdpacks=local and update the navigation in beforeEach hook from /nr1-core/install-newrelic/installation-plan?e2e-test& to /nr1-core/install-newrelic/installation-plan?e2e-test&nerdpacks=local& in the scripts you are testing.

    For example, if you are testing Go agent installation script make the changes as mentioned above in the beforeEach hook method:

         test.beforeEach(async () => {
           browser = await chromium.launch();
           context = await browser.newContext({
            storageState: "e2e/sessions/storageState.json",
          });
           page = await context.newPage();
           await page.waitForLoadState("networkidle");
           await page.goto("/marketplace?e2e-test&");
           await page.getByTestId("marketplace.guided-install-tile").click();
        });

Running the tests

Tests can be triggered via npm task, this will run all the tests in e2e/tests folder

npx playwright test

Individual test scripts can also be run with the following command

npx playwright test <foldername>/<test-file-name>

[for example the command is written in the following way - npx playwright test tests/docker-infra-guided-installation.spec.js]

Should you want to run traces locally you can force tracing to be on with --trace on.

npx playwright test --trace on

Enviornment Variables

To run E2E tests locally, you will need to define env vars with login credentials.

ENV_SECRET_EMAIL='[email protected]'
ENV_SECRET_PASSWORD='mypassword#123'

Workers and Retries

Workers are used to run the scripts parallely. The more workers, the more scripts will be able to run parallely so that the testing time can be reduced.

The purpose of Retries is to re-test the scripts if there is any error while running the scripts. For example if you set retries to 2, it tries to execute the test for 2 times if facing an error while running.

The workers and retries can be modified in playwright.config.js

Disabling Headless mode

To run a playwright e2e test with headless mode disabled (i.e with a visible browser window) you can set headless option to false when launching the browser.

Here is an example commands

To run playwright e2e test with headless mode disabled

npx playwright test --headed

If you want run a specific test file, you can add path to the file at the end of the command

npx playwright test --headed ./tests/mytest.spec.js

Slack-Github workflow subscription

If you wish to notify github workflow actions status, use this command in your slack channel

/github subscribe https://github.com/newrelic/onboarding-e2e-tests workflows:{name:"Guided Installation e2e tests"}

onboarding-e2e-tests's People

Contributors

abasha1234 avatar pchinthapenta avatar pjarugula avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.