Skip to content

Using Jquery on codecept #43

Closed
Closed

Description

@arsa666

Hello,

Is it posible to use Jquery in codecept to locate element. I personally don't like the yield I.grabTextFrom because it does not work inside a loop. I was wondering is jquery can be used here?

Thanks!

Activity

  1. arsa666 commented on Jan 8, 2016

    @arsa666
    Author

    I was able to use jquery with executeScript();

    =)

  2. DavertMik commented on Jan 11, 2016

    @DavertMik
    Contributor

    Is it posible to use Jquery in codecept to locate element.

    I think you are trying to do some complex stuff which is not handled by default actions. No problem.

    But in CodeceptJS tests should be written from a user's perspective. All complex technical stuff can be handled inside a helper. So if you require something custom, please write your own helper. And yes, there you can use executeScript or locate elements in a different manner with webdriverio

  3. arsa666 commented on Jan 11, 2016

    @arsa666
    Author

    Hi Michael,

    I am having trouble getting the grabbers to work with the yield. If I use
    yield then the following code execution stops. Can you please help me
    figure this out? Or give me an example where I can grab text and then
    continue my code execution?

    This post is related to that too:
    #47

    This simple example does not work. Is this a bug in CodeceptJS? or am I
    missing something?

    Scenario('First Scenario', function* (I) {
    let grabberResult = yield I.grabValueFrom('input[name=firstName]');
    I.see('XKJSHJDSJXHJSKHXS'); //this should fail, but passes.
    });

    Arsalan Ahmed

    Senior Software Developer
    Email: ahmedarsalank@gmail.com
    Tele: +50760041240

    On Mon, Jan 11, 2016 at 4:31 PM, Michael Bodnarchuk <
    notifications@github.com> wrote:

    Is it posible to use Jquery in codecept to locate element.

    I think you are trying to do some complex stuff which is not handled by
    default actions. No problem.

    But in CodeceptJS tests should be written from a user's perspective. All
    complex technical stuff can be handled inside a helper. So if you require
    something custom, please write your own helper
    http://codecept.io/helpers/. And yes, there you can use executeScript
    or locate elements in a different manner of webdriverio

    —
    Reply to this email directly or view it on GitHub
    #43 (comment)
    .

  4. DavertMik commented on Jan 11, 2016

    @DavertMik
    Contributor

    You don't use grabberResult here.

    Please copy the whole test so I could check if it works

  5. arsa666 commented on Jan 11, 2016

    @arsa666
    Author

    Thanks for answering. This example is not working:

    'use strict';
    Feature('Testing Begins');
    Before((I) => {
      I.resizeWindow(1500, 1000);
      I.amOnPage('http://absolutenet.com');
    });
    
    Scenario('ANI testing', function*(I){
      I.waitForText('bring your site to life');
      I.amOnPage('http://www.absolutenet.com/');
      let title = yield I.grabTitle();
      console.info(title);
      I.see('bogus text that is not there'); //this should give an error and not success.
    });
  6. DavertMik commented on Jan 11, 2016

    @DavertMik
    Contributor

    Thanks. Bug is reproduced. Working on to fix it

  7. DavertMik commented on Jan 21, 2016

    @DavertMik
    Contributor

    Done in d68b2a7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions