https://cypress.io logo
Join Discord
Powered by
# help
  • g

    green-boots-72737

    11/08/2022, 2:02 PM
    🙏
  • q

    quiet-tiger-15778

    11/08/2022, 2:25 PM
    Hey. Did someone encounter a similar issue https://github.com/cypress-io/cypress/issues/20573 recently?
  • b

    brash-scientist-28014

    11/08/2022, 2:41 PM
    Does anyone know if it is possible to use pageobject functions inside an "cy.origin()"? i am getting the following error Variables must either be defined within the cy.origin() command or passed in using the args option. Defining the page-objects inside the cy.origin() also does not work or i must be doing something wrong....
  • c

    clean-intern-72668

    11/08/2022, 2:41 PM
    Thanks. Where can I do that?
  • m

    mysterious-belgium-25713

    11/08/2022, 2:59 PM
    Do you have a small snippet so we can see what you are trying to do.
  • b

    brash-scientist-28014

    11/08/2022, 3:00 PM
    will create a easy to read snippet
  • f

    fresh-doctor-14925

    11/08/2022, 3:09 PM
    Raise an issue on their Github repo
  • l

    lively-kitchen-54916

    11/08/2022, 3:21 PM
    Hi I posted this late yesterday. Will repost for visibility: but had previously tried 10.9.0. It was previously complaining that it couldn't find the config file (using js format cypress.config.js). I pointed the cypress run CLI to the file using --config-file param and now the file is being found but I'm getting an error that seems to be expecting the old json config file format SyntaxError: /frontend/cypress.config.js: Unexpected token c in JSON at position 0 Cypress versions on the container show as: Cypress package version: 10.11.0 Cypress binary version: 10.11.0 Electron version: 21.0.0 Bundled Node version: 16.16.0 I don't see a config file format flag in the cypress run CLI documentation but it seems like Cypress 10 should not be having this issue. Don't see this exact issue when I search github/SO/google. config file works fine to run Cypress locally and cypress run command also works locally. Any thoughts? posted it here: https://github.com/cypress-io/cypress/issues/24574
  • b

    brash-scientist-28014

    11/08/2022, 3:32 PM
    i think this should give the situation
    Copy code
    /// <reference types="cypress" />
    import { loginPage } from "../../../../page-objects/loginPage";
    import { somePage } from "../../../../page-objects/somePage";
    
    const loginPage = new somePage
    const somePage = new somePage
    
    
    describe('testname', () => {
    
        before('open page', () => {
            cy.visit('https://page.com')
        })
    
        it('should login as someone', () => {
            loginPage.loginPerson()
            cy.contains('This is visible').should('be.visible')
    
            //clicking a button
            cy.contains('Start').click('right')
            //this opens another page than the page.com
            
            cy.origin('https://another.com', () => {
            //here i want to use the objects / functions that are written in the somePage class.
    
            })
        })
    })
  • r

    rapid-belgium-97056

    11/08/2022, 4:03 PM
    Good morning beautiful Cypress people! our team is currently experimenting with the Cypress Studio, im trying to figure out how to make it generate cleaner looking selectors. Any tips?
  • m

    mysterious-belgium-25713

    11/08/2022, 5:01 PM
    I think easiest way would be to add data-test to your elements. Because studio can find them easier.
  • r

    rapid-belgium-97056

    11/08/2022, 5:02 PM
    What if you have those data test and it still does this:
  • m

    mysterious-belgium-25713

    11/08/2022, 5:03 PM
    Haha, uhmmm then i would make an issue on GitHub.
  • r

    rapid-belgium-97056

    11/08/2022, 5:03 PM
    Okay I'll see if I can come up with some kinda reproducer
  • r

    rapid-belgium-97056

    11/08/2022, 5:03 PM
    Thank you!
  • m

    mysterious-belgium-25713

    11/08/2022, 5:04 PM
    Since i dont think that should be the desired result.
  • l

    lively-kitchen-54916

    11/08/2022, 7:28 PM
    Cypress 10 throws error reading js confi...
  • a

    adventurous-electrician-31004

    11/08/2022, 9:14 PM
    Hello everyone, everything good? Can anyone help me with the error: _SignupPage.default is not a constructor Here is the project link: https://github.com/thiagojosepdu/qa_ninja.git
  • m

    mysterious-belgium-25713

    11/08/2022, 9:17 PM
    You cannot do it in your IT step. Because Cypress runs async. If you want to do it then you have to set it outside the describe/it functions. So top level of your file
  • a

    adventurous-electrician-31004

    11/08/2022, 9:20 PM
    I don't understand, how would it be correct?
  • m

    mysterious-belgium-25713

    11/08/2022, 9:21 PM
    Move line 27 to line 3
  • m

    mysterious-belgium-25713

    11/08/2022, 9:32 PM
    also one thing you are doing wrong is you are mixing up 2 principles. 1. in your SignupPage.js you are exporting default new Signup() --> with this you are already instantiating your class. If you do this approach then in your testfile import SignupPage from '../../pages/SignupPage' you can call your methods by doing SignupPage.go SignupPage.filForm() SignupPage.submit(). 2. if you would just use export default SignupPage(); --> this is without the new keyword then you need to do import SignupPage from '../../pages/SignupPage' var or const signUpPage = new SignupPage();
  • m

    mysterious-belgium-25713

    11/08/2022, 9:34 PM
    I would also recommend reading stuff on importing and exporting https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export?retiredLocale=nl
  • a

    adventurous-electrician-31004

    11/08/2022, 9:50 PM
    Thanks! I fix it
  • m

    mysterious-belgium-25713

    11/08/2022, 9:51 PM
    Ok, i also forked your repo because there where some small things in your cadastro not working. https://github.com/Xvier/qa_ninja
  • m

    mysterious-belgium-25713

    11/08/2022, 9:52 PM
    Also some basics you should never commit and push your node_modules. Its clutter for your repository.
  • m

    mysterious-belgium-25713

    11/08/2022, 9:58 PM
    I will see if i can work on this tomorrow afternoon/evening
  • a

    adorable-smartphone-87280

    11/08/2022, 11:32 PM
    Anyone else getting the
    Please verify that the package.json has a valid "main" entry
    error after updating to Cypress 11?
  • a

    adorable-smartphone-87280

    11/08/2022, 11:33 PM
    FWIW, I keep my Cypress tests in a separate package from the main app. Is that a potential issue?
  • n

    numerous-potato-27729

    11/08/2022, 11:59 PM
    Does anyone know if Cypress supports back/forward cache (bfcache)? I can't seem to find any info on it.
1...198199200...252Latest