Skip to content

Commit 08dff37

Browse files
committed
return await t. to each row because of testcafe unstable cases
1 parent ff90dba commit 08dff37

File tree

2 files changed

+44
-54
lines changed

2 files changed

+44
-54
lines changed

tests/e2e/pageObjects/browser-page.ts

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -273,20 +273,18 @@ export class BrowserPage {
273273
* @param value The key value
274274
*/
275275
async addStringKey(keyName: string, value = ' ', TTL?: string): Promise<void> {
276-
await t
277-
.click(this.plusAddKeyButton)
278-
.click(this.keyTypeDropDown)
279-
.click(this.stringOption)
280-
.click(this.addKeyNameInput)
281-
.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
276+
await t.click(this.plusAddKeyButton);
277+
await t.click(this.keyTypeDropDown);
278+
await t.click(this.stringOption);
279+
await t.click(this.addKeyNameInput);
280+
await t.typeText(this.addKeyNameInput, keyName, { replace: true, paste: true });
282281
if (TTL !== undefined) {
283282
await t.click(this.keyTTLInput)
284283
.typeText(this.keyTTLInput, TTL, { replace: true, paste: true });
285284
}
286-
await t
287-
.click(this.stringKeyValueInput)
288-
.typeText(this.stringKeyValueInput, value)
289-
.click(this.addKeyButton);
285+
await t.click(this.stringKeyValueInput);
286+
await t.typeText(this.stringKeyValueInput, value);
287+
await t.click(this.addKeyButton);
290288
}
291289

292290
/**
@@ -582,11 +580,10 @@ export class BrowserPage {
582580
if (await this.toastCloseButton.exists) {
583581
await t.click(this.toastCloseButton);
584582
}
585-
await t
586-
.click(this.addKeyValueItemsButton)
587-
.typeText(this.hashFieldInput, keyFieldValue, { replace: true, paste: true })
588-
.typeText(this.hashValueInput, keyValue, { replace: true, paste: true })
589-
.click(this.saveHashFieldButton);
583+
await t.click(this.addKeyValueItemsButton);
584+
await t.typeText(this.hashFieldInput, keyFieldValue, { replace: true, paste: true });
585+
await t.typeText(this.hashValueInput, keyValue, { replace: true, paste: true });
586+
await t.click(this.saveHashFieldButton);
590587
}
591588

592589
/**
@@ -787,11 +784,10 @@ export class BrowserPage {
787784
* @param jsonKeyValue The value of the json key
788785
*/
789786
async addJsonKeyOnTheSameLevel(jsonKey: string, jsonKeyValue: string): Promise<void> {
790-
await t
791-
.click(this.addJsonObjectButton)
792-
.typeText(this.jsonKeyInput, jsonKey, { replace: true, paste: true })
793-
.typeText(this.jsonValueInput, jsonKeyValue, { replace: true, paste: true })
794-
.click(this.applyButton);
787+
await t.click(this.addJsonObjectButton);
788+
await t.typeText(this.jsonKeyInput, jsonKey, { replace: true, paste: true });
789+
await t.typeText(this.jsonValueInput, jsonKeyValue, { replace: true, paste: true });
790+
await t.click(this.applyButton);
795791
}
796792

797793
/**
@@ -800,24 +796,22 @@ export class BrowserPage {
800796
* @param jsonKeyValue The value of the json key
801797
*/
802798
async addJsonKeyInsideStructure(jsonKey: string, jsonKeyValue: string): Promise<void> {
803-
await t
804-
.click(this.expandJsonObject)
805-
.click(this.addJsonFieldButton)
806-
.typeText(this.jsonKeyInput, jsonKey, { replace: true, paste: true })
807-
.typeText(this.jsonValueInput, jsonKeyValue, { replace: true, paste: true })
808-
.click(this.applyButton);
799+
await t.click(this.expandJsonObject);
800+
await t.click(this.addJsonFieldButton);
801+
await t.typeText(this.jsonKeyInput, jsonKey, { replace: true, paste: true });
802+
await t.typeText(this.jsonValueInput, jsonKeyValue, { replace: true, paste: true });
803+
await t.click(this.applyButton);
809804
}
810805

811806
/**
812807
* Add json structure
813808
* @param jsonStructure The structure of the json key
814809
*/
815810
async addJsonStructure(jsonStructure: string): Promise<void> {
816-
await t
817-
.click(this.expandJsonObject)
818-
.click(this.editJsonObjectButton)
819-
.typeText(this.jsonValueInput, jsonStructure, { replace: true, paste: true })
820-
.click(this.applyEditButton);
811+
await t.click(this.expandJsonObject);
812+
await t.click(this.editJsonObjectButton);
813+
await t.typeText(this.jsonValueInput, jsonStructure, { replace: true, paste: true });
814+
await t.click(this.applyEditButton);
821815
}
822816

823817
/**
@@ -932,10 +926,9 @@ export class BrowserPage {
932926
*/
933927
async openStreamPendingsView(keyName: string): Promise<void> {
934928
await this.openKeyDetails(keyName);
935-
await t
936-
.click(this.streamTabGroups)
937-
.click(this.consumerGroup)
938-
.click(this.streamConsumerName);
929+
await t.click(this.streamTabGroups);
930+
await t.click(this.consumerGroup);
931+
await t.click(this.streamConsumerName);
939932
}
940933

941934
/**

tests/e2e/pageObjects/cli-page.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export class CliPage {
6060
* @param groupName The group name
6161
*/
6262
async selectFilterGroupType(groupName: string): Promise<void> {
63-
await t
64-
.click(this.filterGroupTypeButton)
65-
.click(this.filterOptionGroupType.withExactText(groupName));
63+
await t.click(this.filterGroupTypeButton);
64+
await t.click(this.filterOptionGroupType.withExactText(groupName));
6665
}
6766

6867
/**
@@ -75,12 +74,11 @@ export class CliPage {
7574
const keyValueArray = await common.createArrayWithKeyValueAndKeyname(amount, keyName);
7675

7776
// Open CLI
78-
await t
79-
.click(this.cliExpandButton)
77+
await t.click(this.cliExpandButton);
8078
// Add keys
81-
.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { replace: true, paste: true })
82-
.pressKey('enter')
83-
.click(this.cliCollapseButton);
79+
await t.typeText(this.cliCommandInput, `${keyCommand} ${keyValueArray.join(' ')}`, { replace: true, paste: true });
80+
await t.pressKey('enter');
81+
await t.click(this.cliCollapseButton);
8482
}
8583

8684
/**
@@ -118,10 +116,10 @@ export class CliPage {
118116
*/
119117
async sendCommandInCli(command: string): Promise<void> {
120118
// Open CLI
121-
await t.click(this.cliExpandButton)
122-
.typeText(this.cliCommandInput, command, { replace: true, paste: true })
123-
.pressKey('enter')
124-
.click(this.cliCollapseButton);
119+
await t.click(this.cliExpandButton);
120+
await t.typeText(this.cliCommandInput, command, { replace: true, paste: true });
121+
await t.pressKey('enter');
122+
await t.click(this.cliCollapseButton);
125123
}
126124

127125
/**
@@ -130,11 +128,10 @@ export class CliPage {
130128
*/
131129
async getSuccessCommandResultFromCli(command: string): Promise<string> {
132130
// Open CLI
133-
await t
134-
.click(this.cliExpandButton)
131+
await t.click(this.cliExpandButton);
135132
// Add keys
136-
.typeText(this.cliCommandInput, command, { replace: true, paste: true })
137-
.pressKey('enter');
133+
await t.typeText(this.cliCommandInput, command, { replace: true, paste: true });
134+
await t.pressKey('enter');
138135
const commandResult = await this.cliOutputResponseSuccess.innerText;
139136
await t.click(this.cliCollapseButton);
140137
return commandResult;
@@ -157,8 +154,8 @@ export class CliPage {
157154
* @param url Command URL for external resourse
158155
*/
159156
async checkURLCommand(command: string, url: string): Promise<void> {
160-
await t.click(this.cliHelperOutputTitles.withExactText(command))
161-
.click(this.readMoreButton)
162-
.expect(getPageUrl()).eql(url, 'The opened page not correct');
157+
await t.click(this.cliHelperOutputTitles.withExactText(command));
158+
await t.click(this.readMoreButton);
159+
await t.expect(getPageUrl()).eql(url, 'The opened page not correct');
163160
}
164161
}

0 commit comments

Comments
 (0)