Skip to content

Commit e57bcbc

Browse files
committed
fix for json
1 parent a460857 commit e57bcbc

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

tests/e2e/pageObjects/browser-page.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,17 @@ export class BrowserPage extends InstancePage {
859859
await t.click(this.applyButton);
860860
}
861861

862+
/**
863+
* Add json value inside the Json structure
864+
* @param jsonKeyValue The value of the json key
865+
*/
866+
async addJsonValueInsideStructure(jsonKeyValue: string): Promise<void> {
867+
await t.click(this.expandJsonObject);
868+
await t.click(this.addJsonFieldButton);
869+
await t.typeText(this.jsonValueInput, jsonKeyValue, { paste: true });
870+
await t.click(this.applyButton);
871+
}
872+
862873
/**
863874
* Add json structure
864875
* @param jsonStructure The structure of the json key

tests/e2e/tests/web/smoke/browser/json-key.e2e.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ test('Verify that user can add key with value to any level of JSON structure for
6969
// Check the added key contains json object with added key
7070
await t.expect(browserPage.addJsonObjectButton.exists).ok('The add Json object button not found', { timeout: 10000 });
7171
await t.expect(browserPage.jsonKeyValue.textContent).contains('"key1:"value1"}', 'The json object value not found');
72-
// Add key with value inside the json
73-
await browserPage.addJsonKeyOnTheSameLevel('"key2"', '{}');
74-
await browserPage.addJsonKeyInsideStructure('"key2222"', '12345');
72+
// Add value inside the json array
73+
await browserPage.addJsonValueInsideStructure('12345');
7574
// Check the added key contains json object with added key
76-
await t.expect(browserPage.jsonKeyValue.textContent).contains('key1:"value1"key2:{key2222:12345}}', 'The json object value not found');
75+
await t.expect(browserPage.jsonKeyValue.textContent).contains('"70":12345]', 'The json object value not found');
7776
});

0 commit comments

Comments
 (0)