You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-30Lines changed: 76 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,11 @@ Our package bridges Cypress and Playwright test runs with Google Sheets or CSV,
32
32
33
33
After installing `qa-shadow-report` using the command:
34
34
35
-
`npm i qa-shadow-report`
35
+
npm i qa-shadow-report
36
36
37
37
you will then need to run the command:
38
38
39
-
`npx qasr-setup`
39
+
npx qasr-setup
40
40
41
41
this initiates a series of `Yes` or `No` questions to guide you through setting up the tool for your testing framework and package manager. You may choose to exit the setup at any time by entering `EXIT`, which is not recommended. If you exit setup, you will then need to restart using the command `npx qasr-setup`
42
42
@@ -105,15 +105,15 @@ Before you begin, ensure you have the following packages and authentication. You
-**Google Spreadsheet ID:** Place the sheet's URL directly in an environment variable: `https://docs.google.com/spreadsheets/d/1Y8tQWmo3oSB3zIlr1mySs/edit?gid=160#gid=19160`.
108
+
-**Google Spreadsheet URL:** Place the sheet's URL directly in an environment variable: `https://docs.google.com/spreadsheets/d/1Y8tQWmo3oSB3zIlr1mySs/edit?gid=160#gid=19160`.
109
109
-**Service Account Credentials for Google Sheets:** Follow the detailed guide from `node-google-spreadsheet` they have a great document describing Google Service Accounts [node-google-spreadshee: Google Service Account](https://theoephraim.github.io/node-google-spreadsheet/#/guides/authentication?id=authentication-methods)
110
-
to set up and safely store your credentials, updating`shadowReportConfig.*` (`js`, or `ts`) with the path to these credentials. Use `.gitignore` to secure your credentials within your project.
110
+
to set up and safely store your credentials. update`shadowReportConfig.*` (`js`, or `ts`) with the path to these credentials. Use `.gitignore` to secure your credentials within your project. Allow your service account to Edit the Google Sheet by sharing the google sheet with the service account emial address as an Editor.
111
111
-**qa-shadow-report configuration file:** Usually installed by the setup wizard in the root of your Cypress project, named: `shadowReportConfig.*` (`js`, or `ts`).
112
112
113
113
-`teamNames`: An array of identifiers representing different teams within your organization that may use or contribute to the testing process.
114
114
-`testTypes`: Specifies the types of tests included in your project, such as API tests or UI tests, to help organize and filter test executions.
115
115
-`testCategories`: Defines the categories of tests your project includes, such as smoke tests for quick checks or sanity tests for verifying vital features after builds.
116
-
-`googleSpreadsheetId`: The unique identifier for your Google Sheets project, found within the URL of your Google Sheet. This is used to integrate and sync test result data.
116
+
-`googleSpreadsheetUrl`: The URL of your Google Sheet. This is used to integrate and sync test result data.
117
117
-`googleKeyFilePath`: The file path to your Google service account credentials, which are required to authenticate and interact with Google Sheets API.
118
118
-`testData`: The file path to where your test results in JSON format are stored, typically generated by Cypress or another testing framework.
119
119
-`csvDownloadsPath`: The directory path where the generated CSV files will be saved. This is useful for users who prefer to download and review test results in a CSV format.
@@ -132,7 +132,7 @@ Before you begin, ensure you have the following packages and authentication. You
@@ -168,9 +168,9 @@ Adjust these scripts as needed for your project's requirements.
168
168
169
169
Before you begin, ensure you have the following packages and authentication, you can run the command `npx qasr-setup` which initiates a couple of Yes or No questions to guide you through setting up the tool for your testing framework and package manager:
170
170
171
-
-**Google Spreadsheet ID:** Place the sheet's URL directly in an environment variable: `https://docs.google.com/spreadsheets/d/1Y8tQWmo3oSB3zIlr1mySs/edit?gid=160#gid=19160`.
171
+
-**Google Spreadsheet URL:** Place the sheet's URL directly in an environment variable: `https://docs.google.com/spreadsheets/d/1Y8tQWmo3oSB3zIlr1mySs/edit?gid=160#gid=19160`.
172
172
-**Service Account Credentials for Google Sheets:** Follow the detailed guide from `node-google-spreadsheet` they have a great document describing Google Service Accounts [node-google-spreadshee: Google Service Account](https://theoephraim.github.io/node-google-spreadsheet/#/guides/authentication?id=authentication-methods)
173
-
to set up and safely store your credentials, updating`shadowReportConfig.*` (`js`, or `ts`) with the path to these credentials. Use `.gitignore` to secure your credentials within your project.
173
+
to set up and safely store your credentials. update`shadowReportConfig.*` (`js`, or `ts`) with the path to these credentials. Use `.gitignore` to secure your credentials within your project. Allow your service account to Edit the Google Sheet by sharing the google sheet with the service account emial address as an Editor.
174
174
-**Playwright Configuration**: In the `playwright.config.js` file, specify the reporter like this:
175
175
176
176
```js
@@ -183,7 +183,7 @@ Before you begin, ensure you have the following packages and authentication, you
183
183
-`teamNames`: An array of identifiers representing different teams within your organization that may use or contribute to the testing process.
184
184
-`testTypes`: Specifies the types of tests included in your project, such as API tests or UI tests, to help organize and filter test executions.
185
185
-`testCategories`: Defines the categories of tests your project includes, such as smoke tests for quick checks or sanity tests for verifying vital features after builds.
186
-
-`googleSpreadsheetId`: The URL of your Google Sheet. This is used to integrate and sync test result data.
186
+
-`googleSpreadsheetUrl`: The URL of your Google Sheet. This is used to integrate and sync test result data.
187
187
-`googleKeyFilePath`: The file path to your Google service account credentials, which are required to authenticate and interact with Google Sheets API.
188
188
-`testData`: The file path to where your test results in JSON format are stored, typically generated by Cypress or another testing framework.
189
189
-`scvDownloadsPath`: The directory path where the generated CSV files will be saved. This is useful for users who prefer to download and review test results in a CSV format.
@@ -202,7 +202,7 @@ Before you begin, ensure you have the following packages and authentication, you
@@ -232,7 +232,7 @@ In this example, running npm run playwright-test will:
232
232
233
233
### To Generate Reports In Sheets
234
234
235
-
All commands require that test report data is present, in this example, the report data is generated by the testing framework.
235
+
All commands require that test suite result data is present, in this example, the test suite data is generated by the testing framework, either Cypress or Playwright.
236
236
237
237
-**To run the root `qa-shadow-report` functionality**
238
238
@@ -261,7 +261,7 @@ In this example, running npm run playwright-test will:
261
261
- This command processes the data from the test results and create a detailed report.
262
262
- A new Sheet Tab will be created with the current day's title (e.g., `Mar 24, 2024`), to which this detailed report will be written.
263
263
- If the Sheet has Tabs for the previous month (e.g., current month is April and sheet tabs exist for `Mar 24, 2024`, `Mar 25, 2024`), then a monthly summary will be generated with that previous month's data (`Summary Mar 2024`).
264
-
- The report will fail if JSON test result data is not present.
264
+
- The report will fail if test result data is not present in JSON format.
265
265
- Duplicate Sheet Tabs are not created by defualt, to create a duplicate Tab, use the flag `--duplicate`.
@@ -527,13 +527,13 @@ The `cypress/grep` package has a Tags feature, which allows you to add an Object
527
527
528
528
By integrating `cypress/grep`, you can run subsets of tests based on your annotations, which aligns perfectly with your team's naming conventions and test categorization.
529
529
530
-
### GitHub CI/CD
530
+
### CI/CD
531
531
532
532
This package is best suited for automated nightly runs, enabling teams to efficiently monitor project status and collaborate on test results every morning.
533
533
534
-
**Integrating Google Sheets Credentials with GitHub Actions:**
534
+
**Integrating Google Sheets Credentials with CI/CD:**
535
535
536
-
For seamless integration in GitHub Actions, as required for manual package operation, the Google Sheets credentials need to be appropriately configured. Given the length constraints of GitHub secrets, it may be necessary to compact the Google Sheets key using GPG encryption.
536
+
For seamless integration into CI/CD pipelines, the Google Sheets credentials need to be appropriately configured. Given the length constraints of most CI/CD environment variables, it may be necessary to compact the Google Sheets key using GPG encryption.
537
537
538
538
**Steps for Secure Key Management**
539
539
@@ -542,22 +542,22 @@ For seamless integration in GitHub Actions, as required for manual package opera
542
542
- **Generate a GPG Key Pair:** If not already available, generate a new GPG key pair using the command `gpg --gen-key`.
543
543
- **Encrypt the Secret File:** For a secret file named `google-key.json`, encrypt it by executing `gpg --output google-key.json.gpg --symmetric --cipher-algo AES256 google-key.json`.
544
544
545
-
2. **Storing Encrypted Secrets in GitHub**
545
+
2. **Storing Encrypted Secrets in Repository/CI Environmen**
546
546
547
547
- **Repository Storage:** Include the encrypted file (`google-key.json.gpg`) in the repository.
548
-
- **Creating a GitHub Secret:** Generate a GitHub secret named `GPG_PASSPHRASE` containing the passphrase used for file encryption.
548
+
- **Creating a CI/CD Environment Variable:** Generate a secret named `GPG_PASSPHRASE` containing the passphrase used for file encryption.
549
549
550
-
3. **Decrypting the Secret in GitHub Actions**
551
-
- **Workflow Modification:** Incorporate steps in your GitHub Actions workflow to decrypt the secret file using the stored passphrase. The modifications should align with your project's encryption setup.
550
+
3. **Decrypting the Secret in CI/CD**
551
+
- **Workflow Modification:** Incorporate steps in your CI/CD workflow to decrypt the secret file using the stored passphrase. The modifications should align with your project's encryption setup.
552
552
553
-
**Note:** A suitable GitHub Action configuration is required for this process to function correctly:
0 commit comments