使用jest替换mocha
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { assert } from "chai";
|
||||
import { describe, it, expect } from '@jest/globals'
|
||||
import { chromium } from "playwright";
|
||||
|
||||
describe("mes登录", function () {
|
||||
@@ -32,13 +32,12 @@ describe("mes登录", function () {
|
||||
|
||||
await page.waitForTimeout(1000)
|
||||
let path = await page.evaluateHandle(()=>window.location.hash.substr(1))
|
||||
assert.equal('/dashboard',await path.jsonValue());
|
||||
expect(await path.jsonValue()).toEqual('/dashboard')
|
||||
|
||||
after(async function(){
|
||||
await context.close();
|
||||
await browser.close();
|
||||
})
|
||||
|
||||
// ---------------------
|
||||
await context.close();
|
||||
await browser.close();
|
||||
|
||||
})
|
||||
})
|
@@ -1,7 +1,7 @@
|
||||
import { assert } from "chai";
|
||||
import { describe, it, expect } from '@jest/globals'
|
||||
import { chromium } from "playwright";
|
||||
|
||||
describe('平台', async function(){
|
||||
describe('平台', function(){
|
||||
|
||||
it('登陆', async function(){
|
||||
|
||||
@@ -29,13 +29,12 @@ describe('平台', async function(){
|
||||
await page.click('button:has-text("登录")');
|
||||
|
||||
let path = await page.evaluateHandle(()=>window.location.pathname);
|
||||
assert.notEqual('/user-login.html',await path.jsonValue());
|
||||
|
||||
expect(await path.jsonValue()).not.toEqual('/user-login.html')
|
||||
|
||||
// ---------------------
|
||||
after(async () => {
|
||||
await context.close();
|
||||
await browser.close();
|
||||
})
|
||||
await context.close();
|
||||
await browser.close();
|
||||
})
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user