We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c789f0 commit 5c8a3d2Copy full SHA for 5c8a3d2
1 file changed
ui-tests/cypress/support/commands.js
@@ -220,19 +220,24 @@ Cypress.Commands.add("shouldNotBeHasDisabledClass", (element) => {
220
221
Cypress.Commands.add("shouldContainText", (element, text) => {
222
223
- cy.getElement(element).then(($el) => {
+ setDebugContext({
224
+ assertion: 'contain text',
225
+ expected: text
226
+ });
227
- const actual = $el.text().trim();
228
+ cy.getElement(element)
229
+ .should('contain', text)
230
+ .then($el => {
231
- setDebugContext({
- assertion: 'contain text',
- expected: text,
- actual
- });
232
+ const actual = $el.text().trim();
233
- expect(actual).to.contain(text);
234
235
236
+ expected: text,
237
+ actual
238
239
240
241
242
});
243
0 commit comments