import { Role } from 'testcafe';
const admin = Role('http://localhost:3000' ,async t => { // port: 5000 when yarn build
await t
.typeText('#login', 'admin')
.typeText('#password', '923878')
.click('#submit-button')
}
, { preserveUrl: true }
);
fixture `Test for profile`;
test('Test for user name', async t => {
await t
.useRole(admin)
.click('#avatar')
.expect('#user-name').eql('admin');
});
如果我使用“ yarn start”,则此测试:
如果我使用“ yarn build”,请执行以下测试: