【发布时间】:2019-12-12 15:08:27
【问题描述】:
我正在尝试根据https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html在TC中使用Use Role
在我看来,一切都很好,但我收到了 ERROR 指定的 glob 模式与任何文件都不匹配或默认测试目录为空。
我不明白为什么。有人能指出错误在哪里吗?
> import { ClientFunction } from 'testcafe';
> // take url import config from './Config/config';
> import loginPage from './POM_LoginPage';
> import Elements from './POM_Elements';
>import {Role} from 'testcafe'
>
>
> let l1 = require('./support/global').log[1];
>
> const SuperUser = Role(`${config.baseUrl}`, async t => {
> //Log in as superuser
>
> await loginPage.logIn(l1.username, l1.password)
>
> });
>
> ixture`SanityTests`
> .beforeEach(async t => {
> await t.maximizeWindow() })
> .page`${config.baseUrl}`;
>
>
> test('Navigation to the Users components', async t => {
>
> //Log in
>
> await t.useRole(SuperUser);
>
> //Go to the "other page"
>
> await t.click(Elements.navDropdown);
> await t.click(Elements.usersButton);
>
> const users= ClientFunction(() => window.location.href)
> await
> t.expect(users()).contains(`${config.Url}`);
> })
【问题讨论】:
-
尝试在 cli 参数/配置文件中单引号。
标签: automated-tests roles e2e-testing testcafe web-testing