Search Posts

Category: protractor

How to check, if the edited result exits in protractor?

I have edit an item. and my code is : let articleName = $(‘[placeholder=”Article name”]’);‘Test Item Edited’);; however when i try to check the test case by: expect(articleName.getText()).toContain(‘Test Item Edited’); or expect(articleName.getAttribute(“Test Item Edited”)).toEqual(‘Test Item Edited’); it shows error “Expected ” to contain ‘Test Item Edited’.” in my source code after edit the item the article name is not found. is that the reason? <input _ngcontent-c30=”” class=”mat-input-element mat-form-field-autofill-control ng-pristine ng-valid ng-touched” matinput=”” required=”” […]

Override mock api calls in protractor

My angular app has mock module added for each api call to run it locally. Now I am trying to write protractor test case where I want to override one of the api from those mocked api. Based on that api my view will show different ui components. Now if I create new mock module in my protractor test case with only that single api then page wont render properly. How can I override only […]

Variable loses the assigned value in Protractor test

I am running a protractor test that should check whether a record lives in the grid with a specific licence number. However after going through all the rows it loses the assigned value to the rowNumber variable. Not sure why it’s doing that. rowNumber should equal to the index. This is my test. var rowNumber = null; var rows = element.all(by.repeater(‘(rowRenderIndex, row) in rowContainer.renderedRows track by $index’)); it(‘should find row the created Driver Licence lives […]

End to End tests workspace support for Nx 6

After upgrading to Nx 6, getAppDirectoryUsingCliConfig was removed. What’s replacing this function and how to implement it(an example will be helpful)? Browsing through cli-config-utils,there are four functions getWorkspacePath() getNpmScope() parseTarget() editTarget() serializecode() replaceAppNameWithPath() How was i using this earlier? Please find the below implementation const { getAppDirectoryUsingCliConfig } = require(‘@nrwl/schematics/src/utils/cli-config-utils’) const applicationDirectory= getAppDirectoryUsingCliConfig(); exports.config = { allScriptsTimeout: 11000, specs: [ applicationDirectory+ ‘/e2e/**/*.e2e-spec.ts’ ] So, whenever i run end to end tests inside specific app, the […]

E/configParser – Error message: configuration file cli.js did not export a config object

I am new to protractor, and I successfully setup the protractor in eclipse.I followed this link, where conf.js contains: exports.config = { seleniumAddress: ‘http://localhost:4444/wd/hub’, specs: [‘todo-spec.js’] }; and spec.js contains: describe(‘angularjs homepage todo list’, function() { it(‘should add a todo’, function() { browser.get(‘’); element(by.model(‘todoList.todoText’)).sendKeys(‘write first protractor test’); element(by.css(‘[value=”add”]’)).click(); var todoList = element.all(by.repeater(‘todo in todoList.todos’)); expect(todoList.count()).toEqual(3); expect(todoList.get(2).getText()).toEqual(‘write first protractor test’); // You wrote your first test, cross it off the list todoList.get(2).element(by.css(‘input’)).click(); var completedAmount = […]

Serenity Protractor Click function is not working as expected

Description: I’m doing an automation for a time schedule which has 2 schedule states OPEN, CLOSE and when I select CLOSE it gives a pop-up to submit a reason to CLOSE it and in that pop-up there is a submit button that I have to click to complete the task. And when I press the submit button I’m passing the Status which is “CLOSE” to the onClick method in UI to the method as an […]

Can I run Firefox’s Responsive Design Mode in Protractor?

I’m using mobileEmulation for Chrome testing my app but I’ve realised Firefox has a Responsive Design Mode which simulates a mobile device. Is it possible to add a parameter to run that mode in protractor? For Chrome we can write this in conf.js multiCapabilities: [ { browserName: ‘chrome’, chromeOptions: { mobileEmulation: { deviceName: getDeviceFromParams() } } } ] What about Firefox? Source: AngularJS

Protractor Typescript to launch application using baseUrl

I am using Protractor typescript for automation of angular application. When i run the using “npm run e2e” then i have observed that angular is always listening on https://localhost:4200. I Tried to declare baseUrl in Protractor.conf.js as param as below – params: { baseUrl: ‘’} , I am passing that baseUrl to navigate method in e2e-spec.ts as below – page.navigateTo(browser.params.baseUrl); But i don’t want to pass Url each time in it block to the navigate() […]

How to run All test cases of a single spec sequentially with closing the browser each time in Protractor

I am new to Protractor but aware about the selenium. Suppose there are 5 TCs in a single spec file and I want to run them sequentially. Means one TC should be execute at one time but Protractor is running all those TCs simultaneously. Also, I want to close the browser window after each TCs is being completed (No matter what is the result Pass / Fail). Can you please help me out on it. […]

Next Page »