From 31eb8f6df1459ede787f37a80b09da135b47e11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E9=B9=B0?= <17kungfuboy@gmail.com> Date: Fri, 10 Feb 2023 20:16:33 +0800 Subject: [PATCH] fix: fix some e2e test --- e2e/api.t | 12 ++++++------ e2e/env.t | 2 +- e2e/group.spec.ts | 25 ------------------------- tsconfig.json | 2 +- 4 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 e2e/group.spec.ts diff --git a/e2e/api.t b/e2e/api.t index 6ef769bb4..58ccb18d8 100644 --- a/e2e/api.t +++ b/e2e/api.t @@ -5,7 +5,7 @@ goto "http://localhost:4200" find: - [img { width: 16px }] [img { width: 16px }] = history [label "New Request"] + [img { width: 14px }] [img { width: 14px }] = history [label "New Request"] [select "POST"] = method [input] = input [button "Send"] = sendBtn [label "Headers"] = header @@ -27,12 +27,12 @@ find: wait ---- add New +--- add New API goto "http://localhost:4200" find: - [input 'Search'] [button 'xpath:body > eo-root > eo-pages > div > div > div > eo-api > nz-layout > nz-sider > div > nz-content > nz-tabset > div > div > div.ant-tabs-tabpane.ant-tabs-tabpane-active.ng-star-inserted > div > pc-api-group-tree > header > div']=addBtn + [input 'Search' { height: 22px }] [button '' { height: 32px; width: 32px }] = addBtn addBtn -> hover @@ -43,9 +43,9 @@ find: newApi -> click find: - [button "Save"]=save - [select "POST"]=method [input "/"]=path - [select "Root directory"] [input]=name + [button "Save"] = save + [select "POST"] = method [input "/"] = path + [select "Root Group"] [input] = name # [input]=paramName [input]=desc [input]=example method -> "GET" diff --git a/e2e/env.t b/e2e/env.t index 4a97c1328..c32e31451 100644 --- a/e2e/env.t +++ b/e2e/env.t @@ -31,7 +31,7 @@ find: env -> click find: - [label "Environment"] [button { width: 32px }] = add + [label "Environment"] [img { height: 14px; width: 14px }] = add add -> click diff --git a/e2e/group.spec.ts b/e2e/group.spec.ts deleted file mode 100644 index 9ddaeca21..000000000 --- a/e2e/group.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { test, expect } from '@playwright/test'; -test('test', async ({ page }) => { - page = page as import('playwright').Page; - await page.goto('http://www.postcat.com'); - await page.locator('body').click(); - //Add group - await page.locator('pc-api-group-tree:has-text("GET获取城市今日天气GET新冠全国疫情") path').nth(1).hover(); - await page.getByText('新建分组').click(); - await page.getByLabel('分组名称').click(); - await page.getByLabel('分组名称').fill('test'); - await page.getByRole('button', { name: '确认' }).click(); - await page.waitForTimeout(1000); - await page.locator('body').click(); - // await page.locator('nz-tree-node-title:has-text("test") svg').hover(); - await page.locator('nz-tree-node-title:has-text("test") circle').nth(1).hover(); - await page.getByText('添加子分组').click(); - await page.getByLabel('分组名称').click(); - await page.getByLabel('分组名称').fill('test1'); - await page.getByRole('button', { name: '确认' }).click(); - await page.waitForTimeout(1000); - await page.locator('nz-tree-node-title:has-text("test1") svg').hover(); - //Delete group - await page.locator('a:has-text("删除")').click(); - await page.getByRole('button', { name: '确认' }).click(); -}); diff --git a/tsconfig.json b/tsconfig.json index 0788ec05d..40541847c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,7 @@ "eo/*": ["./src/*"] } }, - "include": ["**/*.d.ts", "./src/**/**.ts", "./src/**/**.js", "scripts/build.js"], + "include": ["**/*.d.ts", "./src/**/**.ts", "./src/**/**.js", "scripts/build.js", "e2e/test.ts", "e2e/test.ts"], "exclude": ["node_modules", "**/*.spec.ts", "**/browser/**/*.js", "**/browser/**/*.ts", "out"], "angularCompilerOptions": { "enableIvy": true