SamikshaV
SamikshaV

Reputation: 1

Unable to launch url from cypress

Sample code:

'''///<reference types = 'Cypress'/>
import LoginPage from '../PageObjects/LoginPage'

describe('Test suite',function(){
    
   it('Verify login', function()
   {
     const loginPage = new LoginPage
     cy.visit('https://stagingURL.com/login/')  <<<<<<<<<<
     loginPage.getUsernameField().type('user1')
     loginPage.getPasswordField().type('pass1')
     loginPage.getSubmitButton().click()   
    })
})'''

If I change URL to any other URL, cy.visit works. But it does not work for my staging envt url. Fails due "secure connection failed" error when launched from Firefox. And fails due to "This page isn't working" error when launched from chrome.

Upvotes: 0

Views: 1013

Answers (1)

cdcastillo
cdcastillo

Reputation: 148

It looks like new LoginPage does not have parenthesis after. It will need to be new LoginPage().

Upvotes: 1

Related Questions