DevExpress / testcafe-angular-selectors

TestCafe selector extensions for Angular apps.
https://testcafe.io
MIT License
31 stars 10 forks source link

Add support for Angular 9 (close #7) #18

Closed enten closed 4 years ago

enten commented 4 years ago

Fixes #7

Developpment notes

There is an issue to make custom method getAngular() works with angular renderer3.

With latest angular renderer3 engine: each component instance have property __ngContext__ which contains circular reference.

I add a workaround to avoid circular structure to JSON issue when getAngular() is called without state projection.

        // workaround to avoid circular structure to JSON because of __ngContext__
        if (state && '__ngContext__' in state) {
            state = JSON.parse(
                JSON.stringify(state, (key, value) => key !== '__ngContext__' ? value : null),
            );
        }
enten commented 4 years ago

@miherlosev Some unit tests failed with Microsoft Edge 79.0.309.68 / Windows 8.1.

I need to find a way to reproduce test failures because I don't have them on local (I'm on archlinux).

enten commented 4 years ago

After some tries I encountered random failures on different browsers. I supposed that is related to performance of the node/container which run tests. Increase timeout to 2000ms helps to fix that random failure behavior.

miherlosev commented 4 years ago

Hi @enten

Thank you for your contribution. We will take a look at this code and investigate the cause of failures.

Farfurix commented 4 years ago

@enten

Hello,

Thank you for the work you've done. We decided to do some refactoring in the context of your changes in the following separate PR.

I published a new version. You can install it using the npm i testcafe-angular-selectors@0.4.0 command.