Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
How to "CTRL + Click" in cypress, pages are linked but ctrl + click does not take me to the correct page

I have two files, a spec file and a page object file. I have imported the page object file inside the spec file. My issue is that when i try to CTRL + click on a reference inside the spec file, it does not take me to the page object file.

The test runs ok but i would like this functionality to be active. What am i missing?

Spec file:


const constants = require("../support/constants")
const positionPage = require("../support/page_objects/positionPage")


describe('Create New Position', () => {

    it('Log In', () => {
        cy.visit(Cypress.env('staging'))
        cy.logIn(Cypress.env('username'), Cypress.env('password'))
    })

    it('Expand menu', () => {
        positionPage.expandMenuButton.click()
    })

    it('Open Position menu', () =>{
        positionPage.createNewPosition('Manager')
    })

})

Page object file:

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

class PositionPage {

    get expandMenuButton () {
        return cy.get('.dash-menu-header > .mobile-menu-button')
    }

    createNewPosition (positionName) {
        cy.get('#topSearchAdd > .dropdown-toggle-mousedown').click();
        cy.get('[ng-if="currentUser.userPermissions.addPosition"] > a').click()
        cy.get('.noBottomMargin > .inputTipWrap > div > .ng-pristine').type(positionName)
    }

}

export default new PositionPage()

Thanks a lot!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The require() syntax seems to be stopping it.

Switching to import

import positionPage from "../support/page_objects/positionPage"

ctrl-click here in the spec

positionPage.expandMenuButton.click()

takes you to here in positionPage

export default new PositionPage()
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda