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

    future-eye-56254

    11/15/2022, 11:40 AM
    If I wrap the kafka consumer code inside a plain javascript file and run it as "node script.js" it logs the output messages on the console perfectly
  • c

    cool-businessperson-53870

    11/15/2022, 11:47 AM
    Hi I am trying to find out some examples of Kafkajs with cypress. Can anyone help ?
  • r

    rough-yacht-92267

    11/15/2022, 1:42 PM
    There is no existing CI integrated into my company's system. For this reason we can't gain the benefits of cypress parallelization as it requires "CI-BUILD-ID" that we do not have access to. This led us to try a different method, which involved using Docker to create multiple containers. Each container would run a set of specs and as a result speed up the testing process. However this came at a cost of using an alternative reporting method (e.g. mochaawsome) instead of using cypress dashboard which my team has already agreed upon. My question is if there is an alternative approach that can be taken which allows us to gain access to the cypress dashboard as well the benefits of parallelization without the need of CI. Any ideas would be greatly appreciated.
  • r

    rough-yacht-92267

    11/15/2022, 1:42 PM
    Is cypress parallelization possible without a CI (continues integration)?
  • f

    fresh-doctor-14925

    11/15/2022, 2:00 PM
    You can specify the ci-build-id yourself by passing it in on the command line. You just need to make sure you're passing it into each of your containers https://docs.cypress.io/guides/guides/parallelization#Linking-CI-machines-for-parallelization-or-grouping
  • r

    rough-yacht-92267

    11/15/2022, 2:05 PM
    @fresh-doctor-14925 Thanks for your response. Does this ci-build-id come from the CI itself. If that is the case we can't access it as we don't have our system integrated to any CI'S. Is it possible for this ci-build-id to be uniquely generated by us? sorry I may not fully understand the reason behind needing CI for parallelization to work so please correct me If I am wrong with anything.
  • f

    fresh-doctor-14925

    11/15/2022, 2:12 PM
    Nah. The name is a little misleading. It can be any string you want. The only important thing is that it's unique to that test. So you will need some kind of mechanism to handle that. Could be as straightforward as just passing in the current epoch timestamp as the build it No CI required
  • m

    mysterious-belgium-25713

    11/15/2022, 2:21 PM
    You cannot use basic node code in Cypress. If you want to utilize it you have to create a Cypress task of it. Cypress has 2 ecosystems one for automation and the other is for direct nodejs functions. Read up on this to run node functions https://docs.cypress.io/api/commands/task
  • a

    acceptable-zebra-54407

    11/15/2022, 2:37 PM
    I'm trying to use Cypress component testing with Vue3/Vite and getting this error:
    Copy code
    Failed to fetch dynamically imported module: http://localhost:5173/__cypress/src/cypress/support/component.js
    I found some closed Github issues but even upgrading the libraries to the latest version didn't help. I'm not sure how to start debugging this
  • a

    acceptable-zebra-54407

    11/15/2022, 3:04 PM
    If I make a request to
    http://localhost:5173/__cypress/src/cypress/support/component.js
    , it does return a JavaScript module
  • b

    bitter-jelly-65084

    11/15/2022, 3:31 PM
    Hello, I am setting up Cypress on a site, and the scrollTo('bottom') command is not working specifically on my site. It works on other sites with the same code, and the page is guaranteed large enough to be able to be scrolled down on. Using ensureScrollable stops the error, but does not scroll the page which I can visibly guarantee can be scrolled. The behavior is the same on Chrome, Edge, and Electron, so not browser specific. All my testing is in the Cypress application, not through command line. Are there any exceptions where scrollTo may be unable to function on a website due to some configuration? I won't be able to link the website in question unfortunately. I have tried all pages on my site and none scroll. When trying other sites, such as the commented out site, it does scroll. So my assumption is something in the large project I am working in, is universally impacting Cypresses ability to scroll on all the pages.
    Copy code
    beforeEach(() => {
          cy.visitSite();
          //cy.visitSite("https://www.bigbinary.com/books/learn-qa-automation-using-cypress/data-cy-conventions");
        })
    
        it.only('Scroll', () => {
          cy.wait(10000);
          cy.window().scrollTo('bottom')
        })
    Any brainstorming on what types of things could be the issue, would be appreciated.
  • r

    ripe-kite-37554

    11/15/2022, 4:12 PM
    Hi, I'm using cypress (freshly downloaded this morning) on an M1 max macbook pro, on Ventura, and it's really struggling performance-wise. It keeps beach-balling, and the UI is frequently unresponsive. are there known issues with ventura, or is this at all expected? I've just got 1 spec, with a handful of cy.intercept calls, one cy.visit, 2 cy.contains, and a cy.location.should()... but it's kinda completely unusable, which is making me very sad 😦
  • r

    ripe-kite-37554

    11/15/2022, 4:31 PM
    yay, i fixeded it - turns out one of my fixture files was 60MB in size, and apparently cypress doesn't like that very much :lol: - we're all good now. thanks for listening!
  • p

    polite-potato-14743

    11/15/2022, 4:32 PM
    a lot of my tests are failing because they are staying logged in between spec files. Any gotchas that i maybe missed?
  • a

    adorable-smartphone-87280

    11/15/2022, 4:36 PM
    Are you using
    cy.session()
    ?
  • a

    adorable-smartphone-87280

    11/15/2022, 4:36 PM
    (if you aren't, you might want to start - that's the direction Cypress will go in the future)
  • p

    polite-potato-14743

    11/15/2022, 4:37 PM
    im not
  • a

    adorable-smartphone-87280

    11/15/2022, 4:37 PM
    It helps with auth state management. If you aren't using it yet, you'll probably need a
    afterEach()
    hook in your tests that forces logout.
  • b

    bitter-fountain-36713

    11/15/2022, 5:46 PM
    Read the requirements of using
    .scrollTo()
    in the docs. It requires being chained off a command that yields DOM element. Your use is incorrect.
  • a

    acceptable-zebra-54407

    11/15/2022, 5:55 PM
    Based on the github issue I found, I thought it might be the fact that my OSX username has a
    .
    in it, but I tried using a different user and still had the same error
  • a

    acceptable-zebra-54407

    11/15/2022, 5:55 PM
    Would really appreciate any ideas of what to try next, or where I can learn more about what this error means
  • b

    bitter-jelly-65084

    11/15/2022, 8:33 PM
    I do not believe that is true. I have used it in both ways directly shown in the documentation. Both ways appear as correct usage in the documentation, tutorials, and in testing on other sites. This is the documentation I am using: https://docs.cypress.io/api/commands/scrollto#Scopes
  • f

    future-eye-56254

    11/15/2022, 8:39 PM
    I tried that too but it simply doesn't get anything though there are mesages. Kafkajs is an npm module. I also tried to write the kafka consumer logic as a module and importing it into the test as below. import { run } from '../kafja.js' before(() => { let data = run() }) it('test 1', () => { //assert values expect(data.key).to.eq('something') }) cc : @gray-kilobyte-89541
  • m

    mysterious-belgium-25713

    11/15/2022, 8:44 PM
    This is not using a task. This is just having a seperate js file and you are importing it in your test code
  • m

    mysterious-belgium-25713

    11/15/2022, 8:45 PM
    Please look at my blog how i use task to connect to a database and try the same stuff for Kafka. https://dev.to/xvier/connecting-cypress-to-a-postgresql-database-3po5
  • w

    worried-lifeguard-15953

    11/15/2022, 10:02 PM
    How do you check that the result of a get()/contains() is a particular HTML tag? For example, if I have:
    Copy code
    <p class="cy">0</p>
    <span class="cy">1</span>
    <div class="cy">2</div>
    How can I do like?
    Copy code
    cy.get(".cy").eq(0).should('be.a', 'p')
    cy.get(".cy").eq(1).should('be.a', 'span')
    cy.get(".cy").eq(2).should('be.a', 'div')
    I feel like this is something that's probably stupidly easy, but I can't find any info on it.
  • e

    enough-truck-68085

    11/15/2022, 10:26 PM
    Not sure Cypress natively has that chai assertion you are looking for https://docs.cypress.io/guides/references/assertions#Chai However, it looks like
    chai-dom
    might do what you want, specifically the
    tagName
    assertions https://www.chaijs.com/plugins/chai-dom/
  • w

    worried-lifeguard-15953

    11/15/2022, 10:30 PM
    Thanks, I'll check it out. Mucking around to see if I can find something using a .then() callback.
  • w

    worried-lifeguard-15953

    11/15/2022, 11:08 PM
    This seems to work:
    Copy code
    cy.get('.cy').eq(0).then(($el) => {
      expect($el[0].localName.to.be.equal('span');
    });
  • r

    rapid-yak-87393

    11/15/2022, 11:27 PM
    you could also do
    cy.get('p.cy')
    as the selector is like a css selector. If theres not a p tag with a cy class then it will fail
1...205206207...252Latest