-
Notifications
You must be signed in to change notification settings - Fork 145
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
Click not working on ion-button (e2e) #62
Comments
Is the button clickable when you click it? Also, I typically use Protractor's
... but maybe I'm old school. Are you receiving errors in the terminal window? If so, what do they look like? |
Same issue here. The problem is that |
Same issue here. loginBtn = element(by.css('button[type="submit"]'));
...
let expected = browser.ExpectedConditions;
await browser.wait(expected.elementToBeClickable(this.loginBtn), 5000);
await this.loginBtn.click(); Results in this error: Error: WebDriverError: unknown error: Element <button class="login-button button button-md button-default button-default-md button-md-primary" color="primary" float-right="" ion-button="" type="submit" ng-reflect-color="primary">...</button is not clickable at point (705, 270). Other element would receive the click:
<div class="click-block click-block-enabled click-block-active"></div> |
I'm also having random issues with click-block never leaving. Try the following: |
@ilkkanisula didn't work for me. it does not error out but the button didn't click |
@philippdrebes were you able to fix it? I am getting the same error as you right now. |
Ok here's the weird part This fails
But this worked
|
Here's what I eventually ended up with, basically I just made it wait for that webElement promise from @ilkkanisula to be fullfilled
|
FWIW: here's what I worked for me after I tried the solutions from @trajano and @ilkkanisula without success // my-page.po.ts
export class MyPagePO {
...
get clickBlocker() {
return element(by.css('div.click-block'));
}
async waitUntilNotBlocked() {
// the loop is needed because the click-block element does not show up immediately
for (var i = 0; i < 3; i++) {
await browser.waitForAngular();
await browser.wait(ExpectedConditions.invisibilityOf(this.clickBlocker));
await browser.sleep(1000);
}
}
...
}
// my-test.e2e-spec.ts
...
let po = MyPagePO();
await browser.wait(ExpectedConditions.elementToBeClickable(po.myButton));
await po.waitUntilNotBlocked();
await po.myButton.click() |
I 'm developing an Ionic 3 PWA (using lazy load). The tests was based on this example. I'm trying to do e2e tests.
My initial test is try to fill a form and click in the submit button of a login screen. I can select the button, altought the click event doesn't works. It should show an error message if the input are empty.
My test:
The text was updated successfully, but these errors were encountered: