TidGi-Desktop/features/stepDefinitions/electron.ts
2021-04-18 21:47:05 +08:00

16 lines
666 B
TypeScript

/* eslint-disable @typescript-eslint/no-unused-expressions */
import { setWorldConstructor, Given, Then, When } from '@cucumber/cucumber';
import { expect } from 'chai';
import { TiddlyGitWorld } from '../supports/world';
setWorldConstructor(TiddlyGitWorld);
Given('the app is launched', { timeout: 120 * 1000 }, async function (this: TiddlyGitWorld) {
await this.start();
});
Then('the element {string} is on the page', { timeout: 120 * 1000 }, async function (this: TiddlyGitWorld, elementSelector: string) {
const result = await this.getElement(elementSelector);
expect(result).to.not.be.undefined;
this.updateContext({ previousElement: result });
});