Skip to content

Commit

Permalink
💚 Fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
harehare committed Oct 31, 2024
1 parent b8687b1 commit d23ee7b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ jobs:
run: npm run test:e2e
working-directory: frontend
env:
API_ROOT: ${{ secrets.API_ROOT }}
WEB_ROOT: ${{ secrets.WEB_ROOT }}
API_ROOT: http://localhost:8081
WEB_ROOT: http://localhost:3000
APP_VERSION: ""
FIREBASE_API_KEY: textusm
FIREBASE_AUTH_DOMAIN: textusm
Expand Down
4 changes: 3 additions & 1 deletion frontend/e2e/textusm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ test('Save the diagram to remote and load it', async ({ page }) => {
await editText(page, 'test1\n test2\n test3');

await page.locator('[data-test-id="save-menu"]').click();
await page.waitForURL(/edit.+/);

await page.waitForLoadState('networkidle');
await page.waitForSelector('[data-test-id="list-menu"]');
await page.locator('[data-test-id="list-menu"]').click();
await page.waitForSelector('[data-test-id="diagram-list-item"]');
await page.waitForLoadState('networkidle');
await page.locator('[data-test-id="diagram-list-item"]').first().click();
await page.waitForLoadState('networkidle');

Expand Down
4 changes: 1 addition & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"elm-review": "^2.12.0",
"elm-test": "^0.19.1-revision12",
"firebase-tools": "^13.15.1",
"kill-port": "^2.0.1",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"size-limit": "^11.0.2",
Expand Down Expand Up @@ -89,12 +88,11 @@
"prod": "NODE_ENV=production NODE_OPTIONS='--max-old-space-size=4096' vite build",
"postprod": "rimraf -rf dist/*.map",
"preview": "concurrently \"vite preview\" \"cd ../backend/ && just run\"",
"preview:dev": "concurrently \"npm run dev:frontend\" \"cd ../backend/ && just run\"",
"prepreview": "npm run prod",
"setup:emulators": "cd .. && firebase init emulators",
"test": "elm-test",
"test:e2e:init": "playwright install --with-deps",
"test:e2e": "firebase emulators:exec --only auth 'playwright test' ; kill-port 8081"
"test:e2e": "firebase emulators:exec --only auth 'playwright test'"
},
"browserslist": [
"defaults"
Expand Down
25 changes: 18 additions & 7 deletions frontend/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@ export default defineConfig({
use: { ...devices['Desktop Firefox'] },
},
],
webServer: {
command: 'DB_TYPE=sqlite FIREBASE_AUTH_EMULATOR_HOST="localhost:9099" USE_HTTPS=0 npm run preview:dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
stderr: 'pipe',
},
webServer: [
{
command: 'npm run dev:frontend',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 10 * 60 * 1000,
stdout: 'pipe',
stderr: 'pipe',
},
{
command: 'cd ../backend && DB_TYPE=sqlite FIREBASE_AUTH_EMULATOR_HOST="localhost:9099" USE_HTTPS=0 just run',
url: 'http://localhost:8081/healthcheck',
reuseExistingServer: !process.env.CI,
timeout: 10 * 60 * 1000,
stdout: 'pipe',
stderr: 'pipe',
},
],
});
13 changes: 13 additions & 0 deletions lua/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local M = {}

local testModule = require('simple-nvim-plugin/testModule')

function M.test()
print('hello world');
end

function M.callModule(str)
testModule.test(str)
end

return M

0 comments on commit d23ee7b

Please sign in to comment.