Visualize diff function in video
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
import { clickOn, sleep, writeText, expandTopic, hideText } from '../util'
|
||||
import { Browser } from 'webdriverio'
|
||||
|
||||
// Expects a topic with at least two messages to be selected
|
||||
export async function compareJsonSideBySide(browser: Browser<void>) {
|
||||
const firstEntry = await browser.$('//span[contains(text(), "History")]/../../div/div[1]/div')
|
||||
const secondEntry = await browser.$('//span[contains(text(), "History")]/../../div/div[2]/div')
|
||||
await clickOn(secondEntry, browser)
|
||||
await sleep(2000)
|
||||
await clickOn(firstEntry, browser)
|
||||
await sleep(2000)
|
||||
await clickOn(firstEntry, browser)
|
||||
await sleep(1000)
|
||||
}
|
||||
17
src/spec/scenarios/showJsonFormatting.ts
Normal file
17
src/spec/scenarios/showJsonFormatting.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { clickOn, sleep, writeText, delteTextWithBackspaces, expandTopic, moveToCenterOfElement, showText } from '../util'
|
||||
import { Browser } from 'webdriverio'
|
||||
|
||||
export async function showJsonFormatting(browser: Browser<void>) {
|
||||
const payloadInput = await browser.$('//*[contains(@class, "ace_text-input")]')
|
||||
await clickOn(payloadInput, browser)
|
||||
await payloadInput.clearValue()
|
||||
await writeTextPayload(payloadInput, '{"action": "setState", "state": "on" }')
|
||||
}
|
||||
|
||||
async function writeTextPayload(payloadInput: any, text: string) {
|
||||
const chars = text.split('')
|
||||
for (const char of chars) {
|
||||
await payloadInput.setValue(char)
|
||||
await sleep(200)
|
||||
}
|
||||
}
|
||||
21
src/spec/scenarios/showOffDiffCapability.ts
Normal file
21
src/spec/scenarios/showOffDiffCapability.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { clickOn, sleep, showText } from '../util'
|
||||
import { Browser } from 'webdriverio'
|
||||
|
||||
// Expects a topic with at least two messages to be selected
|
||||
export async function showOffDiffCapability(browser: Browser<void>) {
|
||||
await showText('Compare messages', 2000, browser, 'top')
|
||||
|
||||
await showText('Show raw message', 2000, browser, 'bottom')
|
||||
const rawMessage = await browser.$('#valueRendererDisplayMode-raw')
|
||||
await clickOn(rawMessage, browser)
|
||||
await sleep(1000)
|
||||
|
||||
await showText('Compare with others', 2000, browser, 'bottom')
|
||||
const diffMessages = await browser.$('#valueRendererDisplayMode-diff')
|
||||
await clickOn(diffMessages, browser)
|
||||
|
||||
// const firstEntry = await browser.$('//span[contains(text(), "History")]/../../div/div[1]/div')
|
||||
const secondEntry = await browser.$('//span[contains(text(), "History")]/../../div/div[2]/div')
|
||||
await clickOn(secondEntry, browser)
|
||||
await sleep(2000)
|
||||
}
|
||||
Reference in New Issue
Block a user