Skip to content

Commit

Permalink
Bm/feature map (#9)
Browse files Browse the repository at this point in the history
* adding feature map calculation

* adding daily run
  • Loading branch information
BMayhew authored Nov 26, 2023
1 parent bce6db7 commit ab6cafb
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ ADMIN_PASSWORD=welcome01
# Required for Currents.dev reporting
# CURRENTS_PROJECT_ID=
# CURRENTS_RECORD_KEY=
# CURRENTS_CI_BUILD_ID=
# CURRENTS_CI_BUILD_ID=

# Calculation Coverage
CALCULATE_COVERAGE=true
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
branches: [main, master]
schedule:
- cron: "0 0 * * 1"
- cron: "0 6 * * *"
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
/playwright/.cache/
.auth/
*_spec3.json
coverage-output.txt

# System Files
.DS_Store
Expand Down
59 changes: 59 additions & 0 deletions featureMap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
- page: "/auth/login"
features:
sign in with google: false
email: true
password: true
login: true
register your account: false
forgot password: false
- page: "/auth/forgot-password"
features:
email: false
set new password: false
- page: "/auth/register"
features:
first name: false
last name: false
date of birth: false
address: false
postcode: false
city: false
state: false
country: false
phone rate: false
e-mail address: false
password: false
register button: false
- page: "/category/hand-tools"
features:
header: true
sidebar:
sort: false
filters: false
by brand: false
product card:
image: false
image zoom: false
title: false
price: false
pagination:
previous: false
next: false
number: false
- page: "/product/{id}"
features:
header: false
product details:
image: false
title: false
tags: false
price: false
description: false
quantity: false
add to cart: false
add to favorites: false
related products:
image: false
title: false
more information: false
footer: false
63 changes: 51 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"license": "ISC",
"devDependencies": {
"@currents/playwright": "^0.10.6",
"@playwright/test": "^1.39",
"@playwright/test": "^1.40",
"typescript": "^5.2.2"
},
"dependencies": {
"dotenv": "^16.3.0",
"feature-map": "^1.0.0",
"js-yaml": "^4.1.0",
"ts-node": "^10.9.1"
}
}
7 changes: 6 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ export default defineConfig<APIRequestOptions & TestOptions>({
timeout: 30_000,
projects: [
{ name: "setup", testMatch: /.*\.setup\.ts/, fullyParallel: true },
{
name: "calculation",
testMatch: /.*\.calculation\.ts/,
},

{
name: "ui-tests",
dependencies: ["setup"],
dependencies: ["setup", "calculation"],
},
],
testDir: "./tests",
Expand Down
12 changes: 12 additions & 0 deletions tests/featuremap.calculation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { test as calculation } from "@playwright/test";
import { calculateYamlCoverage } from "feature-map";

calculation("Feature Map", async () => {
let runCalculationCoverage = process.env.CALCULATE_COVERAGE;
if (runCalculationCoverage) {
console.log("Calculating coverage");
calculateYamlCoverage("./featureMap.yml");
} else {
console.log("Skipping coverage calculation");
}
});

0 comments on commit ab6cafb

Please sign in to comment.