Playwright BDD - GregLinthicum/From-Logistic-Regression-to-Long-short-term-memory-RNN GitHub Wiki

Playwright

Playwright BDD

  • A.1. Install Playwright

  • A.2. Install Cucumber for playwright: npm install playwright @cucumber/cucumber

  • A.3. Sample code with Javascript: Sample Gherkinn code

  • B.1. Gherkin implemented in Typescript: Install: npm install playwright @cucumber/cucumber typescript ts-node @types/node

  • B.2. Create a tsconfig.json file to configure TypeScript: { "compilerOptions": { "target": "ESNext", "module": "commonjs", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true } }

  • B.3. Sample code with Typescript: Sample Gherkinn code

  • B.4. Create package.json with the following content: "scripts": { "test": "cucumber-js --require-module ts-node/register --require ./steps/**/*.ts" }

  • B.5. Using bash command line execute the script: npm run test

Note:

  • ESNext refers to the latest version of ECMAScript, which is the standard for JavaScript. Instead of targeting a specific version (like ES5, ES6/ES2015, or ES2020), ESNext tells the TypeScript compiler to transpile the code to the most recent ECMAScript standards that are currently supported by the JavaScript engine.

  • "Next" implies that the output will include features from the latest and upcoming ECMAScript versions, ensuring that the JavaScript produced remains compatible with the newest features as the language evolves.