0

I am new to cypress and was trying to execute a simple test case using cypress test runner in the electron browser. from the below code the last line(getSearchBox click) is not correct as I have provided the wrong xpath intentionally. But I am unable to see any error message in the test runner. Could you please help? Also attaching the test runner output for your reference. I am expecting an "element not found" error like selenium so that one can easlily understand the issue after seeing the stack trace.

I have also verified that the second last line of my code is getting clicked successfully but no error found after trying the click the searchbox in the last line.

/// <reference types="cypress" />

// Cypress.on('uncaught:exception', (err, runnable) => {
//     // returning false here prevents Cypress from
//     // failing the test
//     return false
// })


import UnibetHomePage from '../../support/pageObjects/UnibetHomePage'
import UpcomingPage from '../../support/pageObjects/UnibetUpcomingPage'
import NewGamesPage from '../../support/pageObjects/UnibetNewGamesPage'

describe('Unibet sample test suite',function()
{
it('cypress unibet testing',async function(){
cy.Login().then(function(){
}) 
const homepage = new UnibetHomePage()
const upcomingpage = new UpcomingPage()
const newgamepage = new NewGamesPage()

homepage.getCasinoOption().click()
newgamepage.getNewGamesOption().click()
newgamepage.getSearchBox().click()

    })

})

Test Runner Logs

Test_Unibet2.js210ms
Unibet sample test suite
cypress unibet testingpassed
TEST BODY
1
visithttps://www.unibet.com/betting/sports/home
2
xpath(//span[contains(text(),"Casino")])[1]
3
click
(page load)--page loaded--
(new url)https://www.unibet.com/casino
4
xpath//div[@data-test-name="game-category-item-New Games"]
5
click
(new url)https://www.unibet.com/casino/newgames

0 Answers0