5

The nice thing of TypeScript you do not have to migrate at once. TypeScript is a superset and can parse plain JavaScript as well. You can keep your old code and start using TypeScript for new code or just some features. Read this story about gradually switching at Slack: One of the reasons why the Slack team chose TypeScript is its being a superset of ...


4

After a long hard fought battle, I was able to overcome this using opposite of what K-8 had suggested. Instead of checking if an element is visible on the viewport, I checked the negative of that, which is if element is not visible on the viewport. So, I did this public waitForSpinnerDisappear(){ let EC = protractor.ExpectedConditions; browser.wait(EC....


4

NO. I would not suggest doing so until you have a specific objective to be met by doing it. In my opinion, its only worth the effort if you are working on large development project but for comparatively smaller UI automation projects with less than 1K tests, I would not suggest so. Also, there are a lot of misconceptions about the advantages of moving ...


2

By default, as per the Mocha documentation on reporters, there is no Excel reporter. There are some CLI reporters (Spec, Dot, etc) and there are HTML and JSON reporters. A quick Google search shows there is an NPM package called Mocha-Insights-Reporter that can generate Excel files. Since Mocha is open-source and has documentation, your other option is to ...


1

WaitForExit() checks only for the presence of and not the visibility . You could use $(selector).waitForDisplayed instead . And also ensure there is no other element with the same selector


1

TSF exposes HTTP endpoints from which you can fetch data. You can find examples here and here.


1

No, You should NOT use static waits, it is a bad practice. Instead...Read below Disclaimer : I am an actual Protractor SDET, who has been using Protractor from last couple of years in actual Large Projects. Using Hard coded waits(static wait) along with every statement is an very bad practice for multiple reasons: It slows down the whole batch execution, ...


1

I think you can use the implicitlyWait option, although it has been removed from the Protractor documentation: onPrepare: function(){ browser.manage().timeouts().implicitlyWait(3000); }, Code example from: https://stackoverflow.com/questions/33299567/where-to-put-implicitlywait-in-protractor Read this!!!: Is it a bad practice to use implicit wait in ...


1

Go to your conf.js file and create an onPrepare function, there you can define and initialize a global variable. Below is a sample: exports.config = { directConnect: true, capabilities: { 'browserName': 'chrome' }, framework: 'jasmine', baseUrl: "http://url.com", specs: ['./*_specs.js'], ...


1

I suggest use pipeable operators : example In TypeScript 2.3 and lower, typings will need to be added to functions passed to operators, as types cannot be inferred prior to TypeScript 2.4. In TypeScript 2.4, types will infer via composition properly. TS 2.3 and under range(0, 10).pipe( map((n: number) => n + '!'), map((s: string) => 'Hello, ' + ...


1

Config file has a params option: Based on https://github.com/angular/protractor/blob/5.4.1/lib/config.ts: "The params object will be passed directly to the Protractor instance, and can be accessed from your test as browser.params. It is an arbitrary object and can contain anything you may need in your test. This can be changed via the command line as: --...


1

First of all, I don't think that your usage of getting text is correct.We need to get the text individually from each element, something like this: element.all(by.css('something')).map(function(elm) { return elm.getText(); }).then(function(texts) { texts.forEach(...); });


1

I could found a solution. login_page.ts driver: ThenableWebDriver; findWelcomeMessageField(){ return this.driver.wait(until.elementLocated(By.id('welcome')), 2000); } public async verifyLoginSuccessful() { const result = await this.findWelcomeMessageField(); if (result != null ){ console.log("Element Found"); return true; ...


1

Have you tried simply scrolling to the bottom without any reference to any object: element(by.className('<any element on page>')).click();//to focus on page first where scroll need to happen browser.executeScript('window.scrollTo(0,document.body.scrollHeight)').then(function() { //whatever you need to check for here } );


Only top voted, non community-wiki answers of a minimum length are eligible