Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get an error of Out of Memory when I wait to be shown an element #4511

Closed
djom202 opened this issue Sep 28, 2017 · 3 comments
Closed

I get an error of Out of Memory when I wait to be shown an element #4511

djom202 opened this issue Sep 28, 2017 · 3 comments

Comments

@djom202
Copy link

djom202 commented Sep 28, 2017

Hi there!

Actually when I need to wait that an element should be displayed I use the Expected Conditions for that, but I have a particular test where this commands is fails and I don't know why.

Bug report

  • Node Version: v.6.9.1
  • Protractor Version: v.5.1.2
  • Browser(s): chrome v60.0.3112.78
  • Operating System and Version MacOX Sierra
  • Cucumber Feature:
  Given the user has not register before
    And the user stay in the register section
  When the user does sign up
    And the user access to profile settings
    And the user clicks on the Change Plan button
    And the user select the "basic" plan
    And the user click on the Subscribe button
  Then the "credit card number" field should have a error // in this part fails
    And the "date expires of credit card" field should have a error
    And the "cvc number" field should have a error
  • Cucumber Step:
  Then(/^the "([^"]*)" field should have a error$/, function(field, cb) {
    var _text = null;
    var _class = user.finds('.spec-cc-decline');

    switch(field){
      case 'credit card number':
        _text = 'Your card number is incomplete.';
        break;
      case 'date expires of credit card':
        _text = 'Your card expiration date is incomplete.';
        break;
      case 'cvc number':
        _text = 'Your card security code is incomplete.';
        break;
    }

    user.waitsFor(_class);

    user.finds(_class).getText().then(function(text){
      expect(text).to.be.equal(_text);
    }).then(cb);
  });
  • A relevant example test:
    In my test I need to wait a red label to be shown then I apply this function, but is weir because in other tests the function is working great, only in this case fails:
this.waitFor = function(_class){
  var timeout = 10000;
  var _el = element.all(by.css(_class)).get(0);

  return browser.wait(
      EC.visibilityOf(_el),
      timeout,
      'Error: the element "' + _class + '" was not found.'
  );
}
  • Output from running the test:
    image

  • The UI modal:
    image

@wswebcreation
Copy link
Contributor

Hi there!

Since it involves usage and debugging (and you haven't used the issue template to indicate otherwise), your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help.

From the getting help section of the README.

Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)

Thanks!

@djom202
Copy link
Author

djom202 commented Oct 3, 2017

Hi @wswebcreation I'm sorry but I have used the issue template for this. You have a big issue here but thanks.

@wswebcreation
Copy link
Contributor

Hi @djom20

What do you exactly mean with

You have a big issue here but thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants