commit 9f43d38e612ee091c4475041a72a4a3c666b3bd3
parent 52e760dd7f991c17861c4b6722814983759fd096
Author: MTRNord <mtrnord1@gmail.com>
Date: Sat, 5 Feb 2022 19:27:10 +0100
Try fixing the e2ee tests
Diffstat:
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
@@ -17,6 +17,7 @@ jobs:
allowed-endpoints: "gitlab.nordgedanken.dev:443"
- name: curl
uses: wei/curl@012398a392d02480afa2720780031f8621d5f94c # master
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
with:
args: -X POST -F "token=$GITLAB_TOKEN" -F "ref=main" -F "variables[GITHUB_COMMIT_ID]=$GITHUB_SHA" https://gitlab.nordgedanken.dev/api/v4/projects/2/trigger/pipeline
env:
diff --git a/e2e/home.spec.ts b/e2e/home.spec.ts
@@ -4,11 +4,11 @@ test.use({
storageState: 'e2e/auth.json'
});
-test('test navigation to details', async ({ page }, testInfo) => {
+test('test navigation to details', async ({ page, baseURL }) => {
page.on('console', msg => console.log(msg.text()));
// Go to http://localhost:3000/
- await page.goto('http://localhost:3000');
+ await page.goto(baseURL || "http://localhost:3000");
// Check for the Home text
await expect(page.locator('h1')).toContainText('Home');
// Click text=Flowers@mtrnord:art.midnightthoughts.space
@@ -18,7 +18,7 @@ test('test navigation to details', async ({ page }, testInfo) => {
]);
- await expect(page).toHaveURL('http://localhost:3000/post/%24xoIMe7tUMb2NhCBZaxsZr2CVkptCVu1GaJ_eJMKbJQo');
+ await expect(page).toHaveURL(`${baseURL || "http://localhost:3000"}/post/%24xoIMe7tUMb2NhCBZaxsZr2CVkptCVu1GaJ_eJMKbJQo`);
// Click svg
@@ -26,5 +26,5 @@ test('test navigation to details', async ({ page }, testInfo) => {
page.waitForNavigation(/*{ url: 'http://localhost:3000/' }*/),
page.click('#matrix-art-logo')
]);
- await expect(page).toHaveURL('http://localhost:3000');
+ await expect(page).toHaveURL(baseURL || "http://localhost:3000");
});
\ No newline at end of file
diff --git a/playwright.config.ts b/playwright.config.ts
@@ -108,6 +108,7 @@ const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run dev-tests',
port: 3000,
+ reuseExistingServer: !process.env.CI,
},
};
export default config;