https://cypress.io logo
Join Discord
Powered by
# general-chat
  • s

    silly-journalist-41771

    06/27/2022, 12:51 PM
    And they function name is chooseDelivery()
  • s

    silly-journalist-41771

    06/27/2022, 12:53 PM
    So chooseDelivery() { Cy.get('[data-test="xxxx"]') }
  • s

    silly-journalist-41771

    06/27/2022, 12:54 PM
    Then I import that function into commands class and add. Click()
  • s

    silly-journalist-41771

    06/27/2022, 12:54 PM
    So I can re use in my spec file
  • a

    agreeable-painting-90494

    06/27/2022, 12:54 PM
    you need to return cy.get(...)
  • s

    silly-journalist-41771

    06/27/2022, 12:54 PM
    Ohh is that why it's not working
  • a

    agreeable-painting-90494

    06/27/2022, 12:54 PM
    Yeah, otherwise it'll return undefined
  • s

    silly-journalist-41771

    06/27/2022, 12:54 PM
    What does returning it do
  • s

    silly-journalist-41771

    06/27/2022, 12:55 PM
    It defines the function
  • s

    silly-journalist-41771

    06/27/2022, 12:55 PM
    With the chained. Click?
  • a

    agreeable-painting-90494

    06/27/2022, 12:55 PM
    it returns a chainable object
  • s

    silly-journalist-41771

    06/27/2022, 12:55 PM
    Ohhh!
  • s

    silly-journalist-41771

    06/27/2022, 12:55 PM
    That makes sense
  • s

    silly-journalist-41771

    06/27/2022, 12:55 PM
    Legend Ash
  • a

    agreeable-painting-90494

    06/27/2022, 12:55 PM
    No probs, hope it works for you
  • l

    late-planet-4481

    06/27/2022, 1:44 PM
    Anyone have a hack for this? Whenever a test fails, I'd like to log the timestamp to the runner log.
  • a

    agreeable-painting-90494

    06/27/2022, 2:24 PM
    I don't use it any more, but we used to have this: -
    Copy code
    function logTimeThenRun() {
            return (info) => {
                console.log('******************************************************************\nFAILED DATE / TIME (UTC):', new Date(), '\n******************************************************************\n');
            }
        }
    
        on('task', {
            failed: logTimeThenRun(),
        });
  • l

    late-planet-4481

    06/27/2022, 2:25 PM
    Thanks, I think this is the bit I need:
    Copy code
    js
    on('task', {
      failed: logTimeThenRun(),
    });
  • a

    agreeable-painting-90494

    06/27/2022, 2:26 PM
    I think so
  • a

    agreeable-painting-90494

    06/27/2022, 2:28 PM
    That's in the plugins/index.js file btw
  • b

    brave-mechanic-83464

    06/27/2022, 2:34 PM
    I'm selftaught automated tester, I'm working with 1 manual tester and frontend developer is reviewing my code. Should I change company to find mentor who will show me right way of writing tests?
  • l

    late-planet-4481

    06/27/2022, 2:40 PM
    Oops, I just realized you're logging to the console. I'd like to log to the runner log. Still good to have it in the console though 👍
  • a

    agreeable-painting-90494

    06/27/2022, 2:41 PM
    Yeah, I don't know if you have access cy.log in that file (perhaps you do, console suited us ok)
  • l

    late-planet-4481

    06/27/2022, 2:49 PM
    The cool thing about the runner is you can see it in the Cypress Dashboard screenshots.
  • r

    rough-carpenter-2704

    06/27/2022, 3:42 PM
    Hi there! I need help to connect an Oracle Database to my Cypress project
  • r

    rough-carpenter-2704

    06/27/2022, 3:42 PM
    Anyone can help me? I tried installing cypress-oracle-db, but it throws an error.
  • l

    late-planet-4481

    06/27/2022, 3:49 PM
    Can't help if we don't know the error message!
  • f

    fresh-doctor-14925

    06/27/2022, 3:52 PM
    Not necessarily. Do some online tutorials for test best practices and Cypress. Learn JS best practices from the frontend colleague. Cement your Cypress knowledge by teaching your manual test colleague. Being in a small team can come with opportunities
  • r

    rough-carpenter-2704

    06/27/2022, 3:52 PM
    Sorry, this is the error I got.
  • r

    rough-carpenter-2704

    06/27/2022, 3:53 PM
    I tried compiling the source code but nothing happened. Or maybe I'm doing something wrong.
1...575859...127Latest