MatButtonHarness is not working on Protractor environment, the following code reproduce the error.
const loader = ProtractorHarnessEnvironment.loader(fixture);
const button = await loader.getHarness(MatButtonHarness);
await button.click();
When executing button.click() the event should execute.
When executing button.click() the event is not executing.
Angular CLI: 9.0.7
Node: 10.17.0
OS: darwin x64
Angular: 9.0.7
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
@angular-devkit/architect 0.900.7
@angular-devkit/build-angular 0.900.7
@angular-devkit/build-optimizer 0.900.7
@angular-devkit/build-webpack 0.900.7
@angular-devkit/core 9.0.7
@angular-devkit/schematics 9.0.7
@angular/cdk 9.2.0
@angular/material 9.2.0
@ngtools/webpack 9.0.7
@schematics/angular 9.0.7
@schematics/update 0.900.7
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2
@LayZeeDK ^^
In the example, you write button.focus(), but in the description, you mention button.click().
I know we discussed MatButtonHarness#click with ProtractorHarnessEnvironment. Are you also experiencing issues with MatButtonHarness#focus?
In the example, you write
button.focus(), but in the description, you mentionbutton.click().I know we discussed
MatButtonHarness#clickwithProtractorHarnessEnvironment. Are you also experiencing issues withMatButtonHarness#focus?
I changed it to click to keep it consistent, anyways focus dont work either
I'm also experience this issue. Instead of calling harness click in my e2e protractor spec
await harness.clickButtonCount();
I just tried to invoke the click with protractor functions
await element(by.id('count-button')).click();
This works but the whole point of using pure harness is gone.
Looking up elements with harness function locatorFor(...) works since I can get all values from my harness elements.
expect(await harness.getButtonLabel()).toBe('Click Me'); // Validates OK
Do you know if this issue is in the pipeline to be fixed?
Do you know if this issue is in the pipeline to be fixed?
@jelbourn @devversion Do you have time to help with a plan?
It seems to be a regression from https://github.com/angular/components/pull/16688, we're clicking at 0,0 now which doesn't seem to trigger the event. I verified that clicking 1,1 does. Will have a fix shortly
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
It seems to be a regression from https://github.com/angular/components/pull/16688, we're clicking at 0,0 now which doesn't seem to trigger the event. I verified that clicking 1,1 does. Will have a fix shortly