Extract A Part Of The Current Url Using A Regular Expression

preview_player
Показать описание

Imagine we are trying to confirm the application URL "/sell/item10001/confirmation"

// yields a string
.should('match', /\/sell\/item\d+\/confirmation/)
.invoke('match', /\/sell\/item(? id \d+)\/confirmation/)
.should('be.a', 'string')
.as('itemId')
})

Рекомендации по теме
Комментарии
Автор

hi gleb. can you make a couple of videos about pseudo-classes? f.e. :hover
after hovering element i have css <attribute name of element which is hovered>:hover+<attribute name of element which is displayed>
how check appropriate behaviors? thanks in advance

serhiipanasenko
Автор

Hi Gleb! The '<>' are missing in the code from the description, this line: .invoke('match', /\/sell\/item(? id \d+)\/confirmation/)

LSvider
Автор

Very interesting trick with (?<id>d+)

jozefszymala
Автор

Hi Gleb! The '<>' are missing around the id, the code from the description: .invoke('match', /\/sell\/item(? id \d+)\/confirmation/)

LSvider