diff --git a/cypress/e2e/1-getting-started/home.cy.ts b/cypress/e2e/1-getting-started/home.cy.ts index 96b994f..23eb6ea 100644 --- a/cypress/e2e/1-getting-started/home.cy.ts +++ b/cypress/e2e/1-getting-started/home.cy.ts @@ -4,36 +4,9 @@ const TRACETEST_API_TOKEN = Cypress.env('TRACETEST_API_TOKEN') || ''; const tracetest = Tracetest(); -const definition = ` - type: Test - spec: - id: aW1wb3J0cyBhIHBva2Vtb24= - name: imports a pokemon - trigger: - type: traceid - traceid: - id: \${var:TRACE_ID} - specs: - - selector: span[tracetest.span.type="http"] - name: "All HTTP Spans: Status code is not 400" - assertions: - - attr:http.status_code != 400 - - selector: span[tracetest.span.type="database"] - name: "All Database Spans: Processing time is less than 100ms" - assertions: - - attr:tracetest.span.duration < 100ms - outputs: - - name: MY_OUTPUT - selector: span[tracetest.span.type="general" name="Tracetest trigger"] - value: attr:name - - name: MY_OUTPUT_2 - selector: span[tracetest.span.type="general" name="Tracetest trigger"] - value: attr:name - `; - describe('Home', { defaultCommandTimeout: 60000 }, () => { before(done => { - tracetest.configure(TRACETEST_API_TOKEN).then(() => done()); + tracetest.configure(TRACETEST_API_TOKEN, 'http://localhost:3000').then(() => done()); }); beforeEach(() => { @@ -47,7 +20,6 @@ describe('Home', { defaultCommandTimeout: 60000 }, () => { tracetest.runTest(definition).then(() => done()); }); - // uncomment to wait for trace tests to be done after(done => { tracetest.summary().then(() => done()); @@ -63,6 +35,33 @@ describe('Home', { defaultCommandTimeout: 60000 }, () => { cy.get('button').contains('OK').click(); }); + const definition = ` + type: Test + spec: + id: aW1wb3J0cyBhIHBva2Vtb24= + name: imports a pokemon + trigger: + type: traceid + traceid: + id: \${var:TRACE_ID} + specs: + - selector: span[tracetest.span.type="http"] + name: "All HTTP Spans: Status code is not 400" + assertions: + - attr:http.status_code != 400 + - selector: span[tracetest.span.type="database"] + name: "All Database Spans: Processing time is less than 100ms" + assertions: + - attr:tracetest.span.duration < 100ms + outputs: + - name: MY_OUTPUT + selector: span[tracetest.span.type="general" name="Tracetest trigger"] + value: attr:name + - name: MY_OUTPUT_2 + selector: span[tracetest.span.type="general" name="Tracetest trigger"] + value: attr:name + `; + it('imports a pokemon', { env: { definition } }, () => { cy.get('[data-cy="import-pokemon-button"]').click(); cy.get('[data-cy="import-pokemon-form"]').should('be.visible'); diff --git a/package-lock.json b/package-lock.json index be94538..64189ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@opentelemetry/sdk-trace-base": "^1.18.1", - "@tracetest/cypress": "^0.0.12-alpha.0" + "@tracetest/cypress": "^0.0.13-alpha.0" }, "devDependencies": { "@mermaid-js/mermaid-cli": "^10.6.1", @@ -472,9 +472,9 @@ "license": "MIT" }, "node_modules/@tracetest/core": { - "version": "0.0.10-alpha.0", - "resolved": "https://registry.npmjs.org/@tracetest/core/-/core-0.0.10-alpha.0.tgz", - "integrity": "sha512-HFgpKzWDshppPNLGjnInH5KrXb3ur6S0FEycuaN4jM0Epc2j4SUoloCKL+ZLvuxTEium9rszW4pXe6/NUh6iUQ==", + "version": "0.0.13-alpha.0", + "resolved": "https://registry.npmjs.org/@tracetest/core/-/core-0.0.13-alpha.0.tgz", + "integrity": "sha512-6+xzzDBbaiBTDwnB/2LjrAiB8YBOoPO/rivHtIP/o/feMHZRLm+pZAAinvS16cuJdwCIVzxmKogBBsIvxHLCIw==", "dependencies": { "js-yaml": "^4.1.0" }, @@ -483,11 +483,11 @@ } }, "node_modules/@tracetest/cypress": { - "version": "0.0.12-alpha.0", - "resolved": "https://registry.npmjs.org/@tracetest/cypress/-/cypress-0.0.12-alpha.0.tgz", - "integrity": "sha512-ZwOCukNekYqOZylJqdpN0pBVahklLu5AF8lFp94m6qRd22wP59LtC9/HsejNV5WIr1UdXUDrfqvulT05qivp/A==", + "version": "0.0.13-alpha.0", + "resolved": "https://registry.npmjs.org/@tracetest/cypress/-/cypress-0.0.13-alpha.0.tgz", + "integrity": "sha512-anLHSev7gPS3+Y8V37IxHL2pj2mCTT2HFSwZm4jy2gFnJooTbGn17QcAvwH6vYlRLWQmLY6/M6/rBpHhGRo08Q==", "dependencies": { - "@tracetest/core": "^0.0.10-alpha.0" + "@tracetest/core": "^0.0.13-alpha.0" } }, "node_modules/@types/json-schema": { diff --git a/package.json b/package.json index 9de23d7..1d49310 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,6 @@ }, "dependencies": { "@opentelemetry/sdk-trace-base": "^1.18.1", - "@tracetest/cypress": "^0.0.12-alpha.0" + "@tracetest/cypress": "^0.0.13-alpha.0" } }