testomatio / check-tests

GitHub action with static analysis for JavaScript tests.
https://testomat.io
20 stars 8 forks source link

Parameterized tests are not uploaded successfully to testomatio #134

Closed bheemvennapureddy closed 8 months ago

bheemvennapureddy commented 1 year ago

State is a parameterized parameter

Screenshot 2023-09-15 at 8 31 44 AM Screenshot 2023-09-15 at 8 31 55 AM
TetianaKhomenko commented 1 year ago

@bheemvennapureddy please add more details on this setup. Thanks

bheemvennapureddy commented 1 year ago

Here is how I upload tests

Issue : 1 Tests are not getting uploaded successfully with --update-ids

TESTOMATIO_PREPEND_DIR="Cash Money" TESTOMATIO={TOKEN} npx check-tests@latest Playwright "**/*{.,_}{test,spec,cy}.ts" --typescript --update-ids


 🚀 Sending data to testomat.io

 🎉 Data received at Testomat.io
    Updating test ids in the source code...
 ✖️  Error in updating test ids Error: ENOENT: no such file or directory, open '/usr/local/azuredevopsagent/_work/1/s/tests/Capo.UI.Testing/Cash Money/tests/acquisition/loanApplicationExistingCustomer.spec.ts'
    at Object.openSync (node:fs:589:3)
    at Object.readFileSync (node:fs:457:35)
    at updateIdsCommon (/home/azureagent/.npm/_npx/876480043fc67df8/node_modules/check-tests/src/updateIds/updateIds.js:28:26)
    at updateIds (/home/azureagent/.npm/_npx/876480043fc67df8/node_modules/check-tests/src/updateIds/index.js:6:10)
    at Command.<anonymous> (/home/azureagent/.npm/_npx/876480043fc67df8/node_modules/check-tests/bin/check.js:150:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/usr/local/azuredevopsagent/_work/1/s/tests/Capo.UI.Testing/Cash Money/tests/acquisition/loanApplicationExistingCustomer.spec.ts'
}
import test from '@lib/BaseTest';
import { ProductType } from '../../../../Capo.UI/src/GraphQL.Testing';

const state = process.env.PROVINCE ?? 'AB';

test.beforeEach(async ({ loginPage, helpers, preLoanAppDisclosuresPage, userPage }, testInfo) => {
    const visitor = await helpers.findVisitor({
        hasLoan: false,
        productType: ProductType.SinglePay,
        isDefaulted: false,
        canDoNewApp: true,
        numOpenLoans: 0,
        state: state,
    });

    await test.step('As a user I login ', async () => {
        loginPage.loadCustomerIntoSession(visitor.visitorKey);
    });
    await test.step('And I apply new loan', async () => {
        await userPage.applyNewLoan();
    });

    await test.step('And I pass license', async () => {
        await preLoanAppDisclosuresPage.preLoanAppDisclosuresSelection(state);
    });
});

test.describe('New Loan Application', () => {
    test.skip(' New Loan Application for Existing Customers @canpre', async ({
        productSelectionPage,
        personalInformationPage,
        incomeInformationPage,
        bankingInformationPage,
        loanAppReviewDisclosuresPage,
    }) => {
        if (state) {
            await test.step('And I select product product type', async () => {
                productSelectionPage.selectLoanType();
            });
        }
        // Fill out personal information
        await test.step('And I enter personal info', async () => {
            await personalInformationPage.personalSectionExistingCustomer(state);
        });
        await test.step('And I enter income info', async () => {
            await incomeInformationPage.selectIncomeSourcesExistingCustomer();
        });
        // Fill out banking information
        await test.step('And I enter bank info', async () => {
            await bankingInformationPage.bankSection();
        });

        // Review and accept disclosures
        await test.step('Then I review and accept disclosures!', async () => {
            await loanAppReviewDisclosuresPage.selectCheckboxes();
        });
    });
});

Failing Spec file

bheemvennapureddy commented 1 year ago

Issue : 2 without update-ids the test upload sucessfully but tests doesn't match

TESTOMATIO_PREPEND_DIR="Cash Money" TESTOMATIO={TOKEN} npx check-tests@latest Playwright "**/*{.,_}{test,spec,cy}.ts" --typescript

 🗒️  File: Cash Money/tests/loan-servicing/get-buyup.spec.ts

= Complete Buy Up Scenario
  - should be visible after login and clicking the Access My Credit link @canpre
_______________________

 🗒️  File: Cash Money/tests/loan-servicing/get-repayment.spec.ts

= Get Cash Page
  - should be visible after logging in and clicking the Get Cash Advance link @canpre
_______________________

 🗒️  File: Cash Money/tests/loan-servicing/refinance.spec.ts

= Refinance Page Test
  - Refinance test @canpre

SKIPPED 3 TESTS:

-  New Loan Application for Existing Customers @canpre Cash Money/tests/acquisition/loanApplicationExistingCustomer.spec.ts:29
- Promise to pay: Single Payment @candev @customerservicing Cash Money/tests/customer-servicing/promise-to-pay.spec.ts:6
- Promise to pay: Payment plan @candev @customerservicing Cash Money/tests/customer-servicing/promise-to-pay.spec.ts:75

TOTAL 26 TESTS FOUND

 🚀 Sending data to testomat.io

 🎉 Data received at Testomat.io
Finishing: Upload Playwright tests

During test run tests are not found

Artifacts file acquisition-loanApplicationNewCustomer-New-Loa-a8cf8-oan-Application-for-Specific-Province-SK-canpre-canpre/video.webm does not exist. Skipping...
Artifacts file acquisition-loanApplicationNewCustomer-New-Loa-a8cf8-oan-Application-for-Specific-Province-SK-canpre-canpre/test-failed-1.png does not exist. Skipping...
Artifacts file acquisition-loanApplicationNewCustomer-New-Loa-a8cf8-oan-Application-for-Specific-Province-SK-canpre-canpre/trace.zip does not exist. Skipping...
Artifacts file acquisition-loanApplicationNewCustomer-New-Loa-a8cf8-oan-Application-for-Specific-Province-SK-canpre-canpre-retry1/video.webm does not exist. Skipping...
Artifacts file acquisition-loanApplicationNewCustomer-New-Loa-a8cf8-oan-Application-for-Specific-Province-SK-canpre-canpre-retry1/test-failed-1.png does not exist. Skipping...
Artifacts file acquisition-loanApplicationNewCustomer-New-Loa-a8cf8-oan-Application-for-Specific-Province-SK-canpre-canpre-retry1/trace.zip does not exist. Skipping...
[TESTOMATIO] Warning: Test could not be matched (404)  New Loan Application for Existing Customers @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province MB @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province AB @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province NB @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province BC @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province NS @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate Account Page Without Selecting Security Question @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province ON @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province NL @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province BC @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province NL @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province SK @canpre
[TESTOMATIO] Warning: Test could not be matched (404) Validate New Loan Application for Specific Province SK @canpre
[TESTOMATIO] 📊 Report Saved. Report URL: https://app.testomat.io/projects/cm-ld/runs/6fc17fe2/report

[TESTOMATIO] ⚠️ Some reported tests were not found in Testomat.io project
[TESTOMATIO] If you use Testomat.io as a reporter only, please re-run tests using TESTOMATIO_CREATE=1
[TESTOMATIO] But to keep your tests consistent it is recommended to import tests first
[TESTOMATIO] If tests were imported but still not matched, assign test IDs to your tests.
[TESTOMATIO] You can do that automatically via command line tools:
[TESTOMATIO] npx check-tests ... --update-ids See: https://bit.ly/js-update-ids
[TESTOMATIO] or for Cucumber:
[TESTOMATIO] npx check-cucumber ... --update-ids See: https://bit.ly/bdd-update-ids
[TESTOMATIO] 🗄️  Total 15 artifacts privately uploaded to S3 bucket  
##[error]Bash exited with code '1'.
Finishing: Run Playwright tests
olexandr13 commented 9 months ago

https://github.com/testomatio/auth0-issues/issues/110

bheemvennapureddy commented 9 months ago

@poliarush @TetianaKhomenko any updates on this ?

olexandr13 commented 8 months ago

@bheemvennapureddy issue with PREPEND_DIR is fixed. Please update to the latest check-tests version