Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Did you try to add offset as defined?
    Abhishek Bhatt
    @AB09
    I am using scrollTo from Puppeteer and tried using offset too but din't get the desired results.
    If i use I.pressKey("PageDown") twice it allows to validate the presence of elements in DOM.
    Since those elements are part of lazy loading module, i guess i will have to use PageDown. Any suggestions or thoughts ?
    Peter Nguyen Tr
    @PeterNgTr
    If it works then using it atm. ^^
    tepmehatop
    @tepmehatop

    Hello all!
    Problem with connection helper codeceptjs-dbhelper
    I have already compleated working tests, but now need additional to db connection.
    Find this one https://www.npmjs.com/package/codeceptjs-dbhelper
    npm install --save-dev codeceptjs-dbhelper npm install --save-dev database-js-postgres

    Added to my codecept.conf.js Helpers

       "DbHelper": {
            "require": "node_modules/codeceptjs-dbhelper"
        },    

    But when i run my tests i get

    Could not load helper DbHelper from module 'node_modules/codeceptjs-dbhelper': Cannot find module 'node_modules/codeceptjs-dbhelper'

    The module exist in folder node_modules/codeceptjs-dbhelper

    version "codeceptjs": "^2.1.4"

    Help please....

    Thiago Delgado Pinto
    @thiagodp
    @tepmehatop Hello,
    did you try to put a "./" before the path?
      ...
      "helpers": {
        ...
        "DbHelper": {
          "require": "./node_modules/codeceptjs-dbhelper"
        }
      },
      ...
    Peter Nguyen Tr
    @PeterNgTr
    I think no need. Cause he installed the package.
    So just require: package-name
    tepmehatop
    @tepmehatop

    So in the end it was not possible to connect codeceptjs-dbhelper, I tried different variants ... very sad ...

    Found another way to use expressjs for this.
    may be useful to someone:
    Connection to db

    var pgp = require("pg-promise")(/*options*/);
    var db = pgp("postgres://user:pass@link:port/dbName");

    Then in test i use for example i get cinfirm code by user id

    var test  = await db.any("SELECT code FROM user_conf WHERE user_id = $1",  281);
    tepmehatop
    @tepmehatop

    Another question regarding REST API.

    For example, the site autotest makes user registration, e-mail, name, pass.
    I press the button to register.
    At this moment POST is sent from the front of the site.

    {name: test
    Email: Tes @ ...........
    ........}.

    In response, the backend sends:
    token, userId and some more data.

    Hence the question, is it possible to pull out the backend answer on the site in the autotest?

    Peter Nguyen Tr
    @PeterNgTr
    I do believe you can try await I.sendPostRequest to get the response.
    tepmehatop
    @tepmehatop

    I do believe you can try await I.sendPostRequest to get the response.
    sendPostRequest for:
    Sends POST request to API.

    It's mean i will send POST from autotests, but i don't need this, i need only to get response already sended by website from POST.

    image.png
    from web already sended post
    not from postman or autotest
    Thiago Delgado Pinto
    @thiagodp
    @tepmehatop That's why codeceptjs-dbhelper is compatible with CodeceptJS 1.x, but you are using CodeceptJs 2.x...
    Christian Wolf
    @christian.wolf_gitlab
    Hi everyone, i have a problem running our codeJS tests on a real iphone via browserstack. It looks like the initial timeout parameter unit is not sent correct. see error msg: [HTTP] --> POST /wd/hub/session/e0376a53-e892-4927-8bbd-6c413abb903d/timeouts {"script":1000}
    [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["type","ms"]} and you sent ["script"]
    does anyone have an idea what causes the error and how to fix it?
    Alexandr Vorobey
    @Vorobeyko

    Hi!
    When I generated steps.d.t file contains :
    type ICodeceptCallback = (i: CodeceptJS.I, Select:CodeceptJS.Select, Input:CodeceptJS.Input, ...args: any) => void;
    Where the hard order arguments.
    Test

    Before(async (I, Input, Select) => {
      await I.amOnPage(stories('Employment'))
      // Input - contains Select methods
      // Select - contains Input methos
      I.changeSelectOption('Выберите тип занятости', 'Не работаю')
    })

    How you solved this problem? (edited)

    Evgenii
    @MavCKwyT
    hi all Why can't I use this?
    Selection_015.png
    Selection_016.png
    Peter Nguyen Tr
    @PeterNgTr
    you should add REST helper
    Evgenii
    @MavCKwyT
    @PeterNgTr It's added, but still the same
    @PeterNgTr }, helpers: { Puppeteer: { show: true, waitForNavigation: ["domcontentloaded", "networkidle0"], waitForAction: 500, windowSize: '1920x1080', chrome: { args: ['--no-sandbox', '--window-size=1920,1080'], }, REST: {}, }, REST: {}, }, REST: {}, };
    Peter Nguyen Tr
    @PeterNgTr
    Evgenii
    @MavCKwyT
    @PeterNgTr I read
    Peter Nguyen Tr
    @PeterNgTr
    what is the error you have?
    Evgenii
    @MavCKwyT
    @PeterNgTr unresolved function or method
    @PeterNgTr I'm doing something wrong.
    but what is it
    Peter Nguyen Tr
    @PeterNgTr
    you send blank endpoint? maybe!
    Evgenii
    @MavCKwyT
    @PeterNgTr I think the problem is something here
    Selection_017.png
    It's like he doesn't see the method I.sendDeleteRequest('/api/users/1');
    Peter Nguyen Tr
    @PeterNgTr
    it should be the same level with Puppeteer helper
    Evgenii
    @MavCKwyT
    @PeterNgTr ok i ll try it
    @PeterNgTr It's there
    but still
    Peter Nguyen Tr
    @PeterNgTr
    did you remove other RESTs?
    Evgenii
    @MavCKwyT
    @PeterNgTr yep. Maybe it should be imported into a test file?
    my demo project using REST.
    Evgenii
    @MavCKwyT
    @PeterNgTr All right. Thanks for your help. Not working yet. I will look for the reason.
    Christian Wolf
    @christian.wolf_gitlab
    @MavCKwyT Are you sure that other I... commands are working in your scenario? like I.say("something") works? If so, your configuration ist still not correct. Maybe you can provide another screenshot of the whole codecept.conf.js file?
    Lalit Sukhwal
    @lalit29
    image.png
    Test getting failed in codecept
    Quinn Wilson
    @lunky
    can someone tell me what codecept_helper is? is it a global ?