Files
TS-CUCUMBER-WDIO-QK/test/step-definitions/steps.ts
isopropilick 29899223e4
Some checks failed
CI / validate (push) Has been cancelled
Enhance CI configuration and documentation; add new action palette adapter
2026-09-15 10:32:11 -06:00

22 lines
886 B
TypeScript

import { Given, Then, When } from '@wdio/cucumber-framework';
import { expect } from '@wdio/globals';
import { getElement } from '../selectors/actionHelper.js';
Given('the user is on the login page', async () => {
await browser.url('/login');
});
When(/^the user logs in with (\w+) and (.+)$/, async (username: string, password: string) => {
await (await getElement('loginPage.inputUsername')).setValue(username);
await (await getElement('loginPage.inputPassword')).setValue(password);
await (await getElement('loginPage.submitButton')).click();
});
Then('the user should see a flash message containing {string}', async (message: string) => {
await expect(await getElement('securePage.flashAlert')).toHaveText(expect.stringContaining(message));
});
Then('the login form should no longer be visible', async () => {
await getElement('loginPage.inputUsername', false);
});