backend.ai-webui icon indicating copy to clipboard operation
backend.ai-webui copied to clipboard

feat: E2E test using Playwright

Open gee05053 opened this issue 2 years ago • 4 comments

This PR resolves https://github.com/lablup/backend.ai-webui/issues/2081

Implement e2e test using playwright Loop Doc

You must make .env file at playwright directory(webui/playwright/.env) and copy and paste below config

[email protected]
SUPER_ADMIN_PASSWORD=wJalrXUt
[email protected]
ADMIN_PASSWORD=cWbsM_vB
[email protected]
USER_PASSWORD=C8qnIo29
[email protected]
USER2_PASSWORD=P7oxTDdz
[email protected]
INCORRECT_PASSWORD=dasdnsajdnk
PAGE_URL=http://localhost:9081
ENDPOINT=http://localhost:8090
CREATE_VFOLDER_GROUP=test_peoject
NOT_CREATE_VFOLDER_GROUP=default
DELETE_VFOLDER=vMyFkaomKN9vkTORaywaleDayTjYGXwDyB4LPxUiLFvVAWCW2iFjEtJzzXZ8gNK3
NEW_SESSION_VERSION=Ubuntu 20.04 aarch64
NEW_SESSION_MOUNTED_VFOLDER=test
DELETE_SESSION=vNkj
CREATE_USER_NAME=test9
[email protected]
CREATE_USER_PASSWORD=test123!
[email protected]

How to run

  1. Follow extension guide to install extension
  2. Pull this branch
  3. Open test explorer at left side bar as in the picture below 스크린샷 2023-12-26 오후 6 03 33
  4. Click to play button at test explorer or beside of code lines to run test 스크린샷 2023-12-26 오후 6 06 55
  5. You can check the testing process through browser and test result on terminal 스크린샷 2023-12-26 오후 6 13 36 스크린샷 2023-12-26 오후 6 13 55

Checklist: (if applicable)

  • [x] Mention to the original issue
  • [x] Documentation
  • [ ] Minium required manager version
  • [ ] Specific setting for review (eg., KB link, endpoint or how to setup)
  • [ ] Minimum requirements to check during review
  • [ ] Test case(s) to demonstrate the difference of before/after

gee05053 avatar Dec 21 '23 08:12 gee05053

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2115.d3g9cs6u59b8lw.amplifyapp.com

@gee05053 This PR doesn't have any description of how to run the test. Please add it with related links.

yomybaby avatar Dec 26 '23 02:12 yomybaby

@gee05053 When I run npx playwright install I got errors:

Error: test file "e2eTest.spec.ts" should not import test file "pages/CredentialPage.spec.ts"

   at e2eTest.spec.ts:1

> 1 | import { createUser, deleteUser } from './pages/CredentialPage.spec';
    | ^
  2 | import { createVfolder, deleteVfolder } from './pages/DataStoragePage.spec';
  3 | import { login } from './pages/LoginPage.spec';
  4 | import { createSession, deleteSession } from './pages/SessionPage.spec';

Error: test file "e2eTest.spec.ts" should not import test file "pages/DataStoragePage.spec.ts"

   at e2eTest.spec.ts:1

> 1 | import { createUser, deleteUser } from './pages/CredentialPage.spec';
    | ^
  2 | import { createVfolder, deleteVfolder } from './pages/DataStoragePage.spec';
  3 | import { login } from './pages/LoginPage.spec';
  4 | import { createSession, deleteSession } from './pages/SessionPage.spec';

Error: test file "e2eTest.spec.ts" should not import test file "pages/LoginPage.spec.ts"

   at e2eTest.spec.ts:1

> 1 | import { createUser, deleteUser } from './pages/CredentialPage.spec';
    | ^
  2 | import { createVfolder, deleteVfolder } from './pages/DataStoragePage.spec';
  3 | import { login } from './pages/LoginPage.spec';
  4 | import { createSession, deleteSession } from './pages/SessionPage.spec';

Error: test file "e2eTest.spec.ts" should not import test file "pages/SessionPage.spec.ts"

   at e2eTest.spec.ts:1

> 1 | import { createUser, deleteUser } from './pages/CredentialPage.spec';
    | ^
  2 | import { createVfolder, deleteVfolder } from './pages/DataStoragePage.spec';
  3 | import { login } from './pages/LoginPage.spec';
  4 | import { createSession, deleteSession } from './pages/SessionPage.spec';




To open last HTML report run:

  npx playwright show-report

yomybaby avatar Jan 08 '24 03:01 yomybaby

Coverage report for ./react

St.:grey_question:
Category Percentage Covered / Total
🔴 Statements 3.02% 102/3378
🔴 Branches 3.19% 69/2165
🔴 Functions 1.5% 17/1133
🔴 Lines 3.08% 102/3315

Test suite run success

20 tests passing in 4 suites.

Report generated by 🧪jest coverage report action from 278c09f01d8ccf7cf1d3ca694739cdb30a5906ff

github-actions[bot] avatar Feb 13 '24 05:02 github-actions[bot]

There have been many changes in the UI after this PR was created. Therefore, I will close this PR without merging and continue working from https://github.com/lablup/backend.ai-webui/pull/2647 . @gee05053 Thank you for your contribution.

yomybaby avatar Aug 21 '24 01:08 yomybaby