mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
lint: dprint
This commit is contained in:
parent
a3bd62846d
commit
830e11aa77
151 changed files with 2071 additions and 1541 deletions
|
|
@ -1,30 +1,30 @@
|
|||
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
||||
import { setWorldConstructor, Given, Then } from '@cucumber/cucumber';
|
||||
import { Given, setWorldConstructor, Then } from '@cucumber/cucumber';
|
||||
import { delay } from 'bluebird';
|
||||
import { expect } from 'chai';
|
||||
import { TidGiWorld } from '../supports/world';
|
||||
|
||||
setWorldConstructor(TidGiWorld);
|
||||
|
||||
Given('the app is launched', async function (this: TidGiWorld) {
|
||||
Given('the app is launched', async function(this: TidGiWorld) {
|
||||
await delay(100);
|
||||
await this.start();
|
||||
const windowCount = await this.app?.client?.getWindowCount();
|
||||
expect(windowCount).equal(1);
|
||||
});
|
||||
|
||||
Then('the element {string} is on the page', async function (this: TidGiWorld, elementSelector: string) {
|
||||
Then('the element {string} is on the page', async function(this: TidGiWorld, elementSelector: string) {
|
||||
const result = await this.getElement(elementSelector);
|
||||
expect(result).to.not.be.undefined;
|
||||
this.updateContext({ previousElement: result });
|
||||
});
|
||||
Then('click on this element', async function (this: TidGiWorld) {
|
||||
Then('click on this element', async function(this: TidGiWorld) {
|
||||
expect(this.context?.previousElement).to.not.be.undefined;
|
||||
if (this.context?.previousElement !== undefined) {
|
||||
await this.context.previousElement.click();
|
||||
}
|
||||
});
|
||||
Then('click on {string} element', async function (this: TidGiWorld, elementSelector: string) {
|
||||
Then('click on {string} element', async function(this: TidGiWorld, elementSelector: string) {
|
||||
const result = await this.getElement(elementSelector);
|
||||
expect(result).to.not.be.undefined;
|
||||
if (result !== undefined) {
|
||||
|
|
@ -32,7 +32,7 @@ Then('click on {string} element', async function (this: TidGiWorld, elementSelec
|
|||
await result.click();
|
||||
}
|
||||
});
|
||||
Then('{string} window show up', async function (this: TidGiWorld, windowName: string) {
|
||||
Then('{string} window show up', async function(this: TidGiWorld, windowName: string) {
|
||||
// await delay(1000);
|
||||
const windowCount = await this.app?.client?.getWindowCount();
|
||||
expect(windowCount).equal(2);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import { After, Before } from '@cucumber/cucumber';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import { DEFAULT_WIKI_FOLDER } from '../../src/constants/paths';
|
||||
import { SETTINGS_FOLDER } from '../../src/constants/appPaths';
|
||||
import { DEFAULT_WIKI_FOLDER } from '../../src/constants/paths';
|
||||
import { TidGiWorld } from './world';
|
||||
|
||||
Before(async function () {
|
||||
Before(async function() {
|
||||
// clear setting folder
|
||||
await fs.remove(SETTINGS_FOLDER);
|
||||
await fs.remove(DEFAULT_WIKI_FOLDER);
|
||||
});
|
||||
|
||||
After(async function (this: TidGiWorld, testCase) {
|
||||
After(async function(this: TidGiWorld, testCase) {
|
||||
// print logs if test failed
|
||||
// if (this.app !== undefined && testCase.result?.status === Status.FAILED) {
|
||||
// console.log('main:\n---\n');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue