We are in the process of upgrading our application from AngularJS to the latest version of Angular.
I am currently working on writing tests that transition from the AngularJS version of the app to the admin application, which is built using the latest version of Angular. Below is the test script I am attempting to execute:
describe('Admin App - Create Users', () => {
beforeAll(async() => {
await loginPage.login(companyUser, companyUserPwd)
await common.navigationOpenByClick()
await navPage.navigateToApp(AppParams.apps.admin.navLink)
await admin.navigateAdmin('Users')
})
afterAll(async() => {
await common.signOut()
})
_.forEach(CommonStrings.Strings.differentStrings, firstName => {
it(`Create a New User First Name - ${firstName}`, async() => {
await admin.createNewUser({
userConfig: {
firstName
},
clickSave: false
})
expect(admin.newUserAcceptBtn.getAttribute('disabled')).toBe(`true`)
await admin.newUserCancelBtn.click()
})
})
}
In the beforeEach()
hook, I attempt to navigate to the admin application and click on the Users
link to access that specific section within the admin app. However, I encounter an error where it fails to click on the Users
section, resulting in the following error message:
Failed: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See http://git.io/v4gXM for details"
After reviewing the provided link, it appears that a redirect is causing this issue. I tried implementing different solutions mentioned in the error message but none seemed to resolve the problem.
browser.sleep()
partially resolved the initial error, however, it led to encountering the allScriptsTimeout
in my protractor.config file.
browser.refresh()
did not provide a solution.
browser.wait(EC.urlContains('end of link to the admin application'))
helped eliminate the previous error, yet I faced the allScriptsTimeout
once again.
I am seeking advice on additional approaches I can try to ensure the successful execution of this test suite.