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

    stocky-dream-36427

    05/10/2021, 5:28 PM
    Whatever command is "pinned" will be printed in the console
  • p

    prehistoric-action-94870

    05/10/2021, 5:49 PM
    Thanks @stocky-dream-36427 I would like to output the results in the cypress log like so: 1. Person name 1 - person job title 1 2. Person name 2 - person job title 2 3. Person name 3 - person job title 3 Etc. This is to verify filter search functionality
  • s

    stocky-dream-36427

    05/10/2021, 5:50 PM
    You can cy.log in a loop
  • p

    prehistoric-action-94870

    05/10/2021, 5:51 PM
    What’s happening right now with the code above is: 1. Person name 20 - person job title 1 2. Person name 20 - person job title 2 3. Person name 20 - person job title 3
  • s

    stocky-dream-36427

    05/10/2021, 5:52 PM
    Copy code
    js
    cy.wrap(/* your object */)
      .then((people) => {
        people.forEach((person) => {
          // if person is an index, you'll wanna do (_, person) but I don't remember
          cy.log(`${person.name} - ${person.jobTitle}`)
        })
      })
  • s

    stocky-dream-36427

    05/10/2021, 5:52 PM
    I think something like this will work?
  • s

    stocky-dream-36427

    05/10/2021, 5:52 PM
    if you're working with objects
  • s

    stocky-dream-36427

    05/10/2021, 6:05 PM
    you can pass in cy.whatever(..., { log: false }) into any command to make it not show up if you wanna ignore the
    1. Person name 20 - person job title 1
    logs
  • p

    prehistoric-action-94870

    05/10/2021, 6:24 PM
    Thanks @stocky-dream-36427 I’ll try that out 🙂
  • u

    user

    05/10/2021, 9:31 PM
    Hello all, does Cypress currently have an alerting feature? aka I want to be notified when a test fails in CI for example or is this something we have to check through the Cypress dashboards manually
  • a

    ancient-appointment-66951

    05/11/2021, 5:31 AM
    The dashboard has both slack and github notification that you can configure: https://www.cypress.io/dashboard/
  • b

    brash-dusk-82631

    05/12/2021, 12:42 PM
    hello guys, I am glad to join the Cypress community. I have one question - Is there a way to record the test runs data inside the Dashboard when the tests are executed through the Test Runner or they are only recorded when running the tests via the CLI command?
  • s

    stocky-dream-36427

    05/12/2021, 2:59 PM
    You mean with
    cypress open
    ?
  • s

    stocky-dream-36427

    05/12/2021, 3:00 PM
    Just curious, why do you want to do that? @User
  • s

    stocky-dream-36427

    05/12/2021, 3:00 PM
    I think you can do
    cypress run --headed
    and it'll let you see what's going on (launch the browser) and also record.
  • b

    brash-dusk-82631

    05/12/2021, 3:03 PM
    @User yes, with cypress open. I was just wondering if that is an option. The reason is that in our organization members of the Product team want to execute the tests and look at the results and they feel more comfortable doing that via the UI of cypress open.
  • b

    brash-dusk-82631

    05/12/2021, 3:05 PM
    For me and the other guys in the tech team is totally fine running them headless
  • s

    stocky-dream-36427

    05/12/2021, 3:20 PM
    The dashboard recordings generally happen in CI instead of locally.
  • s

    stocky-dream-36427

    05/12/2021, 3:21 PM
    But if you want to run them against the dashboard locally w/ open, then
    cypress run --headed
    is what you want
  • b

    brash-dusk-82631

    05/12/2021, 3:28 PM
    thanks for the info
  • u

    user

    05/13/2021, 7:05 PM
    Hi everyone! I am new to cypress and I want to get the Vuex store on tests. I saw a post on cypress blog that recommended to get thet store like that:
    const get store = () => cy.window().its("app.$store").
    Or like a command
    Cypress.Commands.add("getStore", () => { return cy.window().its("app.$store") .then(appStore =>cy.wrap(appStore)); });
    But both ways I get a warning on console telling me:
    [Vue warn]: Property or method "nodeType" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties
    Is there other way to get the store or resolve this warning? I appreciate the help. thanks in advance!
  • s

    stocky-dream-36427

    05/13/2021, 10:48 PM
    Hey! that's not something we support anymore. App isn't available on window.
  • s

    stocky-dream-36427

    05/13/2021, 10:48 PM
    I need more than that error to help you debug because that error can happen for a lot of different reasons. Many of which are within your component code.
  • s

    stocky-dream-36427

    05/13/2021, 10:49 PM
    I'm curious about why you want to access the store.
  • b

    breezy-australia-64868

    05/14/2021, 2:11 PM
    Heya! Using component testing, how could I mock an import in a Vue file? I have a component that dynamically registers a Vuex module on mount, and I'm using a mocked Vuex store for the test. I could add the module to my mocked rootStore but my component still tries to register the module, and the import is throwing some errors related to API stuff used in the real store. Essentially I would love to use jest.mock() to replace the import of the module. Or if I could mock my api file like they mention at https://vuex.vuejs.org/guide/testing.html#testing-actions that would let me use my real store and would be even better. Thanks!
  • s

    stocky-dream-36427

    05/14/2021, 4:09 PM
    👋 you don't want to mock your store.
  • s

    stocky-dream-36427

    05/14/2021, 4:09 PM
    You want to mock your API at the network level with cy.intercept
  • s

    stocky-dream-36427

    05/14/2021, 4:10 PM
    Don't think in files, think about your component as it literally works in prod: using fetch/XHR to send requests instead of a specific network lib (e.g. axios)
  • s

    stocky-dream-36427

    05/14/2021, 4:10 PM
    This makes your tests VERY resilient to refactoring. They should only really break if the behavior changes.
  • s

    stocky-dream-36427

    05/14/2021, 4:11 PM
    If you need to sub in modules, you can use cy.stub and pass it into the mounting options
1...91011...252Latest