Reputation: 117
I am trying to use Use Role in TC according to the https://devexpress.github.io/testcafe/documentation/test-api/authentication/user-roles.html
In my opinion, everything is ok but I receive an ERROR The specified glob pattern does not match any file or the default test directories are empty.
I do not understand why. Could somebody point where is the mistake?
> 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}`);
> })
Upvotes: 2
Views: 713
Reputation: 5227
This problem is not related to the Roles feature. The error message tell about that you specifying a wrong glob path pattern for the executed tests. Check that the specified path value match any tests. For more information see the Runner.src method description.
Upvotes: 2