Skip to content

Commit

Permalink
Add link check
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Jan 22, 2024
1 parent 165e558 commit 58654f1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
restore-keys: |
yarn-
- name: Lint the application
shell: bash -l {0}
working-directory: frontend
run: |
set -eux
yarn install
yarn run lint:check
- name: Package the application
shell: bash -l {0}
run: |
Expand Down
5 changes: 4 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"scripts": {
"build": "cross-env NODE_ENV=development webpack --config webpack.config.js",
"build:prod": "cross-env NODE_ENV=production webpack --config webpack.config.js",
"eslint": "eslint --ext .js,.jsx,.ts,.tsx src/",
"eslint": "eslint --fix --ext .js,.jsx,.ts,.tsx src/",
"eslint:check": "eslint --ext .js,.jsx,.ts,.tsx src/",
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"lint": "yarn prettier && yarn eslint",
"lint:check": "yarn prettier:check && yarn eslint:check",
"clean": "rimraf ./lib ../tljh_repo2docker/static/js/react"
},
"devDependencies": {
Expand Down
28 changes: 14 additions & 14 deletions frontend/ui-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "tljh_repo2docker-ui-tests",
"version": "1.0.0",
"description": "tljh_repo2docker UI Tests",
"private": true,
"scripts": {
"test": "npx playwright test --workers 1",
"test:update": "npx playwright test --update-snapshots",
"test:debug": "PWDEBUG=1 npx playwright test --workers 1"
},
"license": "BSD-3-Clause",
"dependencies": {
"@playwright/test": "^1.31.0",
"rimraf": "^4.1.2"
}
"name": "tljh_repo2docker-ui-tests",
"version": "1.0.0",
"description": "tljh_repo2docker UI Tests",
"private": true,
"scripts": {
"test": "npx playwright test --workers 1",
"test:update": "npx playwright test --update-snapshots",
"test:debug": "PWDEBUG=1 npx playwright test --workers 1"
},
"license": "BSD-3-Clause",
"dependencies": {
"@playwright/test": "^1.31.0",
"rimraf": "^4.1.2"
}
}
10 changes: 5 additions & 5 deletions frontend/ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
timeout: 120000,
reporter: [[process.env.CI ? "dot" : "list"], ["html"]],
reporter: [[process.env.CI ? 'dot' : 'list'], ['html']],
use: {
baseURL: "http://localhost:8000",
video: "retain-on-failure",
baseURL: 'http://localhost:8000',
video: 'retain-on-failure'
},
retries: 0,
expect: {
toMatchSnapshot: {
maxDiffPixelRatio: 0.005,
},
maxDiffPixelRatio: 0.005
}
}
};
5 changes: 2 additions & 3 deletions frontend/ui-tests/tests/ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ test.describe('tljh_repo2docker UI Tests', () => {
test('Render servers page', async ({ page }) => {
await login(page, 'alice');
await page.getByRole('link', { name: 'Servers' }).click();
// await page.getByRole('button', { name: 'Create new Server' });
await page.waitForTimeout(1000)
await page.waitForURL('**/servers');
await page.getByText('No servers are running');
expect(await page.screenshot()).toMatchSnapshot();
});
test('Render environments page', async ({ page }) => {
await login(page, 'alice');
await page.getByRole('link', { name: 'Environments' }).click();
await page.waitForTimeout(1000)
await page.waitForURL('**/environments');
await page.getByText('No environment available');
expect(await page.screenshot()).toMatchSnapshot();
});
Expand Down

0 comments on commit 58654f1

Please sign in to comment.