I want to use an element across a test case
Call an element across test case: orderIDReplace is element from the selected element in test create order
(fixture app
). I want to use/call orderIDReplace in test receive order
(fixture backend
)
fixture `app`
.page `https://example.com/`
.beforeEach(async t => {
await t
.click(`#username`)
.typeText(`#username`, `test`, {paste : true})
.click(`#password`)
.typeText(`#password`, `test`, {paste : true})
.click('#submit')
.wait(3000)
})
test('Create Order', async t => {
.await t
......
.click(Selector('div').withAttribute('class','vBtnContent').withText('Apply'))
let orderID = await Selector('p').withAttribute('class', 'g-invoice--code').nth(0).innerText;
let orderIDReplace = (lib.replaceCharacter(orderID));
})
fixture `backend`
.page `https://contoh.com/`
.beforeEach(async t => {
await t
.click(`#name`)
.typeText(`#name`, `coba`, {paste : true})
.click(`#password`)
.typeText(`#password`, `coba`, {paste : true})
.click('#submit')
.wait(3000)
})
test('receive order', async t => {
.await t
.click('#txtSearch')
.typeText('#txtSearch', orderIDReplace, {paste: true})
.click('#filter')
Expected result: The result is order id
Actual result: Error: The "text" argument is expected to be a non-empty string, but it was "".