Code E2E Testing Policy

Code E2E Testing Policy

Code QualityNetspective Unified Process
 


All the Software developers of Netspective Communications LLC across all the projects must have a consistent code e2e testing process.

Controls

All are required to adhere to the e2e testing tool that aligns with their development technology listed below.

Language / Frameworke2e Testing ToolRemarks
ReactJSPlaywrightWe use Playwright to e2e test react components

ReactJS

All developers who use ReactJS as programming language must use Playwright as the e2e testing tools. [FII-CQI-110-CEP-01]

  • Ensure to execute the below command in the CLI to initialize playwright installation and configuration.

    pnpm dlx create-playwright
  • Ensure to provide playwright/e2e as answer for the question Where to put your end-to-end tests? during the playwright configuration. [FII-CQI-110-CEP-02]

  • Ensure to provide true as answer for the question Install Playwright browsers (can be done manually via 'pnpm exec playwright install')? (y/N) during the playwright configuration. [FII-CQI-110-CEP-03]

  • Ensure to provide true as answer for the question Install Playwright operating system dependencies (requires sudo / root - can be done manually via 'sudo pnpm exec playwright install-deps')? (y/N) during the playwright configuration. [FII-CQI-110-CEP-04]

  • Ensure to add the below provided content to package.json to execute end to end test using the ‘npm run e2e’ command

    "scripts": {
      "e2e": "playwright test",
      "e2e:dot": "playwright test --reporter=dot",
    },

    [FII-CQI-110-CEP-05]

  • Ensure npm run e2e:dot command will run to execute e2e testing in the whole project. [FII-CQI-110-CEP-06]

  • Ensure to modify the configuration file playwright.config.ts with React reference Project. [FII-CQI-110-CEP-07]

  • All React developers must ensure they are following React reference Project for React code quality.

Evidence

ReactJS

[FII-CQI-006-CUP-03] Execute the below duckdb query in a CLI to verify package.json contains required packages, e2e command, and e2e:dot command.

 duckdb -s "SELECT name,type,version,scripts->>'e2e' as 'e2e',scripts->>'e2e:dot' as 'e2e:dot',devDependencies['@playwright/test'] as '@playwright/test' FROM read_json_auto('package.json');"

[FII-CQI-060-CFP-01.4] Execute the below command in the CLI to run e2e:dot command and output e2e test result.

duckdb -s "SELECT UNNEST(regexp_split_to_array('$(pnpm run e2e:dot)', '\n')) as 'E2E Test Result';"

ensure getting output as

Running <total test count> tests using 1 worker
························
<count> passed (<time>)

Approved by
Abdul Razak on September 19, 2023 |
Last Updated by
Abdul Razak PM on September 19, 2023