Skip to content
Snippets Groups Projects
Commit e04a3f42 authored by Artur Carvalho's avatar Artur Carvalho
Browse files

Try run e2e on ci

parent 2f6839e0
No related branches found
No related tags found
1 merge request!1Add initial libraries
Pipeline #67673 failed
stages:
- build
- test
- e2e
build app:
stage: build
......@@ -8,7 +9,6 @@ build app:
script:
- npm ci
- npm run build
- echo "ENV URL $CI_ENVIRONMENT_URL"
artifacts:
paths:
- build
......@@ -20,3 +20,23 @@ unit tests:
- npm ci
- npm run test:unit
# https://playwright.dev/docs/ci#gitlab-ci
e2e tests:
stage: e2e
image: mcr.microsoft.com/playwright:v1.29.0-focal
before_script:
- cd e2e
- npm i # todo: cache from build?
- npx playwright install
script:
- npm run test:e2e
cache:
key: ${CI_COMMIT_REF_SLUG}-e2e
paths:
- node_modules
artifacts:
when: always # on_failure
paths:
- out/report
reports:
junit: results.xml
......@@ -4,5 +4,5 @@ import { test, expect } from "@playwright/test";
// https://playwright.dev/docs/intro
test("visits the app root url", async ({ page }) => {
await page.goto("/");
await expect(page.locator("#app > div > main")).toHaveText("This is a Vvue playground.");
await expect(page.locator("#app > div > main")).toHaveText("This is a Vue playground.");
});
......@@ -6,6 +6,6 @@ import HelloWorld from "../HelloWorld.vue";
describe("HelloWorld", () => {
it("renders properly", () => {
const wrapper = mount(HelloWorld, { props: { msg: "Hello Vitest" } });
expect(wrapper.text()).toContain("Hello Viteest");
expect(wrapper.text()).toContain("Hello Vitest");
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment