【问题标题】:TestCafe: User Roles - ERROR The specified glob pattern does not match any file or the default test directories are emptyTestCafe:用户角色 - 错误指定的 glob 模式与任何文件都不匹配或默认测试目录为空
【发布时间】: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


【解决方案1】:

此问题与Roles 功能无关。错误消息告诉您为执行的测试指定了错误的全局路径模式。检查指定的路径值是否与任何测试匹配。 有关详细信息,请参阅Runner.src 方法说明。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-08
    • 1970-01-01
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多