openlang

Can Playwright assertions allow either of two possible text values?

I'd like to verify that the text contains either one or two:

await expect(this.title).toHaveText('one').or('two')

Can this be made to work in Playwright?

Could the same thing also appear within a sentence, for example

await expect(this.title).toHaveText("this is "+('first').or('second')+ "sentence");

The conversation continues 2

Follow the reasoning

Other sides of the same question

  1. Can gdb set a breakpoint for an assembly instruction using its address?

    My attempt: apparently this command does not exist, though. Can gdb do something like this?

    Replies 2Latest activity assembly
  2. Why is TsLint requesting a return type for this function's callSignature?

    My code includes the following function: TsLint reports this error for it: Could somebody clarify the message for me?

    Replies 2Latest activity typescript
  3. Getting Godot system time for a digital clock?

    I'm building a digital clock for my game, so I need the present time (hours and minutes) displayed like this: HH:MM:SS Where…

    Replies 2Latest activity gdscript