Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: E2E test using Playwright #2115

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d34f1e8
install cypress and make signin test
gee05053 Nov 28, 2023
91234cf
change package-lock.json
gee05053 Nov 28, 2023
a968fa8
add changeProfile test
gee05053 Nov 29, 2023
af235bd
modify code more simply
gee05053 Nov 30, 2023
19fdf8f
delete unused import
gee05053 Nov 30, 2023
e8c82cd
Merge branch 'main' into feat/e2eTesting-cypress
gee05053 Dec 4, 2023
883e761
change test account
gee05053 Dec 4, 2023
3ed72e1
Merge branch 'main' into feat/e2eTesting-cypress
gee05053 Dec 6, 2023
a88a633
implemnet createVfolder test
gee05053 Dec 6, 2023
f77af2f
implement delete vfolder test
gee05053 Dec 6, 2023
4e5aa4a
apply prettier and change DataPage to DataStoragePage
gee05053 Dec 7, 2023
9244b1f
fix: apply prettier
gee05053 Dec 7, 2023
8417746
implement launch session e2e test
gee05053 Dec 7, 2023
be7b2b9
fix:change vfolderName to mountVfolderName
gee05053 Dec 7, 2023
bbe8641
implement delete session test
gee05053 Dec 7, 2023
945811e
fix:add cy.wait() to see test process
gee05053 Dec 7, 2023
4842f34
Merge branch 'main' into feat/e2eTesting-cypress
gee05053 Dec 14, 2023
0c61074
feat:implement add user and delete user
gee05053 Dec 14, 2023
52075fc
fix:remove unused params
gee05053 Dec 14, 2023
7787479
feat:add playwright and implement test
gee05053 Dec 18, 2023
cb750c7
feat:implment delete session test
gee05053 Dec 18, 2023
e063020
fix:modify vfolder name to use params
gee05053 Dec 18, 2023
cd906f3
fix:add login with endpoint
gee05053 Dec 18, 2023
d50da4c
feat:implement delete vfolder test
gee05053 Dec 18, 2023
761ad32
feat:implement create and delete user
gee05053 Dec 19, 2023
bf52ed7
fix:modify code to use id
gee05053 Dec 19, 2023
6a60045
fix:add ;
gee05053 Dec 19, 2023
f44554c
fix:apply prettier
gee05053 Dec 19, 2023
79af354
fix:change sessionStoragePage to sessionPage
gee05053 Dec 20, 2023
6d7e7c8
fix:wrong import
gee05053 Dec 20, 2023
ed49d55
fix:remove cypress
gee05053 Dec 21, 2023
697c523
fix:rewrite prepare that was deleted by mistake
gee05053 Dec 26, 2023
f5ce4dd
fix:prettierrc.json
gee05053 Dec 27, 2023
549c9b4
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Jan 8, 2024
aa146db
fix:modify test structure
gee05053 Jan 15, 2024
99331b4
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Jan 15, 2024
c2aeffd
fix:modify code structure and add helper
gee05053 Jan 16, 2024
48fac67
fix:modify CredentialPage code structure
gee05053 Jan 16, 2024
2319d1d
fix:modify SessionPage code structure
gee05053 Jan 16, 2024
c6f4386
fix:add comment and modify expect
gee05053 Jan 18, 2024
4132b4c
fix:modify result is shown as list
gee05053 Jan 18, 2024
a4e6f90
Merge branch 'main' into feat/e2etesting-playwright
gee05053 Jan 21, 2024
d1c2f1f
fix:add data-testid
gee05053 Jan 21, 2024
aa9c3f9
fix:rollback user-list component
gee05053 Jan 21, 2024
f96cb1f
remove unnecessary whiteSpace
gee05053 Jan 21, 2024
32fefb0
fix:apply dotenv and waitForResponse
gee05053 Jan 22, 2024
a58c74a
fix:add .eslintignore and solve eslint error
gee05053 Jan 22, 2024
908e165
fix:modify timeout and apply testid
gee05053 Jan 22, 2024
1e5e747
fix:apply dotenv and waitForRequest
gee05053 Jan 22, 2024
6448fa4
fix:apply dotenv and data-testid at CredentialPage
gee05053 Jan 22, 2024
4b6b143
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Jan 23, 2024
c6b8e4b
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Jan 29, 2024
de93d54
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Feb 6, 2024
ba081d6
fix:update after react-root
gee05053 Feb 8, 2024
8839be6
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Feb 13, 2024
0765b9a
modify endpoint url to dotenv
gee05053 Feb 13, 2024
34396e2
Merge branch 'main' into feat/e2eTesting-playwright
gee05053 Feb 21, 2024
fe7a755
fix: remove hard code about group_id and add request test code about …
gee05053 Feb 21, 2024
278c09f
feat: add test about show list by group
gee05053 Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ src/lib/backend.ai-client-node-to-es6.js
src/lib/backend.ai-client-node-test-native-es6.js
src/lib/Chart.min.js
src/lib/json_to_csv.js
playwright/*
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ src/plugins/*

#
!.vscode/i18n-ally-*
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
src/lib/
!/src
!/react
!/playwright
yomybaby marked this conversation as resolved.
Show resolved Hide resolved
**/__generated__/*.graphql.ts
*.graphql
95 changes: 92 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-typescript": "^7.23.2",
"@babel/types": "^7.23.2",
"@playwright/test": "^1.40.1",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-replace": "^5.0.2",
Expand Down
81 changes: 81 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// require('dotenv').config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './playwright/',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [['list', { printSteps: true }]],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
timeout: 80000
},

/* Test firefox browsers
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
*/
/* Test webkit browsers
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
*/

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
13 changes: 13 additions & 0 deletions playwright/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"importOrderSeparation": true,
"importOrderParserPlugins": ["typescript", "decorators"],
"printWidth": 80,
"bracketSpacing": true,
"trailingComma": "all",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"htmlWhitespaceSensitivity": "ignore",
"singleAttributePerLine": false
}
9 changes: 9 additions & 0 deletions playwright/helper/helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const generateRandomString = (
length = 64,
chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
) => {
let result = '';
for (let i = length; i > 0; --i)
result += chars[Math.floor(Math.random() * chars.length)];
return result;
};
Loading
Loading