automated-tests - TestCafe:用户角色 - 错误指定的 glob 模式与任何文件都不匹配或默认测试目录为空

标签 automated-tests roles e2e-testing testcafe web-testing

我正在尝试根据 https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html 在 TC 中使用使用角色

在我看来,一切都很好,但我收到了 错误指定的全局模式与任何文件都不匹配或默认测试目录为空。

我不明白为什么。有人能指出错误在哪里吗?

> 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}`);
>       })

最佳答案

此问题与 Roles 无关特征。错误消息表明您为执行的测试指定了错误的全局路径模式。检查指定的路径值是否与任何测试匹配。 欲了解更多信息,请参阅Runner.src方法说明。

关于automated-tests - TestCafe:用户角色 - 错误指定的 glob 模式与任何文件都不匹配或默认测试目录为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59307565/

相关文章:

rest - 如何实现基于角色的 REST API

testing - 在 TestCafe 中使用标签(Smoke、regression)

python - 运行《Learning Python the Hard Way Ex46》中的 Nose 测试时出现未知错误

java - 自动化集成测试 : Use xUnit?

c# - 如果一个测试用例在通过 VSTS 运行相关测试时失败,则整个测试套件将失败

asp.net-mvc-4 - 表单验证 : Roles (MVC 4) C#

java - 我如何为 iOS 编写我的第一个 Appium 测试

php - Symfony2 中 isGranted 的替代品

testing - nestjs中e2e测试如何配置中间件

angularjs - 失败 : Timed out waiting for Protractor to synchronize with the page