Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
obteniendo el error _LoginPage.default no es un constructor

este es mi codigo

 /// \<reference types = "cypress" /\> class LoginPage { visit() { cy.visit("https://ec2-35-179-99-242.eu-west-2.compute.amazonaws.com:2021/") } username(name) { const field = cy.get('[id=UserName]') field.clear() field.type(name) return this } Password(pwd) { const pass = cy.get('[id=Password]') pass.clear() pass.type(pwd) return this } Submit() { const button = cy.get('[type=submit]') button.click() } } export default LoginPage
 /// \<reference types = "cypress" /\> import LoginPage from './PageObject/LoginPage' it('valid test', function() { const Login = new LoginPage() Login.visit() Login.username('arslan') Login.Password('123') Login.Submit() })

hago objeto de la clase de inicio de sesión

 const Login = new LoginPage()

pero obtener un error al obtener el error _LoginPage.default no es un constructor

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Intente usar una exportación con nombre

 export class LoginPage { visit() { cy.visit("https://ec2-35-179-99-242.eu-west-2.compute.amazonaws.com:2021/") } ... }

e importar así

 import { LoginPage } from './PageObject/LoginPage'
about 4 years ago · Juan Pablo Isaza Report

0

Debe usar el nombre reservado de la function antes de todos los nombres de sus funciones o declarar las funciones como una const usando una función de flecha como:

 function visit() { cy.visit("https://ec2-35-179-99-242.eu-west-2.compute.amazonaws.com:2021/") }

o

 const visit = () => { cy.visit("https://ec2-35-179-99-242.eu-west-2.compute.amazonaws.com:2021/") }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!