vendredi 26 juillet 2019

How to use ".contains" assertion to match one of the values

As per my application, clicking on one of the link can open one of the urls's from two url's.

Eg: Clicking on Link - X, it can open one of the below url's : http://example.com/value1 or http://example.com/value2

I have to write an .contains assertions for this which can look something like this:

expect(currentUrl).contains(value1 or value2)

As per the TestCafe documentation, contains does not have support for regular expression and I do not want to use Match as I have to pass in complete url there.

Please let me know how this can be done. Thanks.

Aucun commentaire:

Enregistrer un commentaire