diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..9cca45de2c0e0b43470c96167f56f99f770db490 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +stages: + - build + - test + +build app: + stage: build + image: node:16-alpine + script: + - npm ci + - npm run build + - echo "ENV URL $CI_ENVIRONMENT_URL" + artifacts: + paths: + - build + +unit tests: + stage: test + image: node:16-alpine + script: + - npm ci + - npm run test + diff --git a/e2e/vue.spec.ts b/e2e/vue.spec.ts index 72371798b6440bda28e22f3ca4608e79f8b60d8d..39923f701367f53300d727c411d83d816709b0c4 100644 --- a/e2e/vue.spec.ts +++ b/e2e/vue.spec.ts @@ -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("div.greetings > h1")).toHaveText("You did it!"); + await expect(page.locator("#app > div > main")).toHaveText("This is a Vvue playground."); }); diff --git a/playwright.config.ts b/playwright.config.ts index 03c06539ff1aa1d1cad6011e2a23436299f292b0..2cb61c012a26dab8e2818af494b913af45f048a7 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -34,7 +34,7 @@ const config: PlaywrightTestConfig = { /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ actionTimeout: 0, /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: "http://localhost:5173", + baseURL: process.env.CI_ENVIRONMENT_URL || "http://localhost:5173", /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: "on-first-retry",