1

I am working with taiko and gauge right now and have several asserts as e.g.

assert.ok(text("example").exists())

But now I delete some text parts and want to check that the text really is deleted. I tried

assert.equal(text("example").exists(), false)

but that fails. I suppose that exists() doesn't return booleans since assert.equal(text("example").exists(), true)also fails, while the above .ok is correct.

Is there any function like assert.notOk(text("example").exists())?

Thanks for your help in advance!

Polly
  • 11
  • 2

2 Answers2

0

text("example").exists() waits for the text and fails if the text is not available on the page after specific interval of time.

Try using exists function as follows

text("example").exists(0,0) // i.e. (retryInterval, retryTimeout)

This will check the page immediately and return a boolean.

Zabil
  • 81
  • 2
0

You can add the expected result (true or false) to your assert:

assert.ok(text("example").exists(), false)

This will result in a true if the search pattern does not exists.

myeongkil kim
  • 2,465
  • 4
  • 16
  • 22
AnPla
  • 32
  • 1
  • 5