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

E2E Karma tests click() do not work for links #1310

Closed
henrysxie opened this issue May 8, 2014 · 13 comments
Closed

E2E Karma tests click() do not work for links #1310

henrysxie opened this issue May 8, 2014 · 13 comments

Comments

@henrysxie
Copy link

After upgrading from beta-1 to beta-4, all my E2E tests which use clicks break. Interestingly, it seems to work for button elements, but not for anchor elements. For example:

element('.class-on-some-button-element').click(); works as expected
element('.class-on-some-anchor-element').click(); does not reflect click at all

Is there a new click handler or something?

I'd really like to upgrade Ionic but this is holding me back.

@henrysxie
Copy link
Author

Is anyone having the same problem? I think the breakage starts with ionic beta-2

@ajoslin
Copy link
Contributor

ajoslin commented May 11, 2014

Hey @xie1989 ,

this makes sense. We re-did the click detection system in beta.2.

I'll look at this on Monday. I have some ideas to fix this.

@henrysxie
Copy link
Author

Sounds good. Thanks, @ajoslin!

@henrysxie
Copy link
Author

Any update here, @ajoslin?

@ajoslin
Copy link
Contributor

ajoslin commented May 13, 2014

Apologies, forgot about this yesterday.

Just pushed a small addition to disable ionic tap during e2e tests, can you try it out? The nightly build will have the fix within about 20 minutes from this comment.

@henrysxie
Copy link
Author

Yup, this works. Thanks so much, @ajoslin!

@henrysxie
Copy link
Author

Actually, I think my celebration was premature. It still only works for button clicks but not clicks on anchor elements for some reason.

@ajoslin
Copy link
Contributor

ajoslin commented May 13, 2014

Hmm.. what browser/device are you running e2e tests in?

@henrysxie
Copy link
Author

I put a debugger in the code and ran my e2e tests. Interestingly, angular.scenario was still undefined for me. If I force the if condition to fail, my tests pass. So I'm trying to figure out what the appropriate if condition should be for knowing whether you're in an e2e test.

@henrysxie
Copy link
Author

I use Karma v0.10.8 and Chrome 34.0.1847 (Mac OS X 10.9.2)

@ajoslin
Copy link
Contributor

ajoslin commented May 13, 2014

Are you including angular-scenario.js?

@henrysxie
Copy link
Author

No, just using the ng-scenario framework had worked for me before. Here's my current karma config file:

module.exports = function(config) {
  config.set({
    basePath : '../',
      files : [
        'test/e2e/**.js',
      ],
      urlRoot: '/_karma_/',
      frameworks: ['ng-scenario'],
      autoWatch : false,
      browsers : ['Chrome'],
      singleRun : false,
      proxies : {
        '/': 'http://localhost:5000/'
      }
  });
};

Am I supposed to load the angular-scenario.js file manually somewhere?

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 6, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants