Quantcast
Channel: User Just code - Stack Overflow
Viewing all articles
Browse latest Browse all 41

Protractor - Angular Goes out of sync for feature modules

$
0
0

I am trying to run angular e2e tests using protractor.

Here is my angular project looks like:

Angular Project

  • Main module

    • HR module (Feature module)
    • Register Module (Feature module)

For my e2e tests they are running fine if I try to execute tests on main module, but for the feature modules it goes out of sync.

The error I am receiving is -Angular is not defined. and some times element is not visible within specified timeout

Spec code:

describe('Page name', () => {    it('should be able to load page', async () => {        navigateToPage('hr/csvimport');        browser.waitForAngular();        const settingsName = generateRandomNumber();        let btnAdd = element(by.id('btnAdd'));        await btnAdd.click();        //expect condition   });});

Navigate to page code:

export const navigateToPage = async (path) => {    console.log('set location '+ path);    if (path === '/' || path === '') {        await browser.get('/');    } else {        await browser.waitForAngular().then(() => {            browser.get('/'+ path);        });        }    };

My best guess is that because of the feature module having different script loading it some how goes out of sync with angular. currently its frozen on click only and tests stops.

Question: how to make it sync with the angular?


Viewing all articles
Browse latest Browse all 41

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>