wlsf82 / protractor-helper Goto Github PK
View Code? Open in Web Editor NEWWrite robust and flakiness-free tests with Protractor.
Home Page: https://wlsf82.github.io/protractor-helper/
License: MIT License
Write robust and flakiness-free tests with Protractor.
Home Page: https://wlsf82.github.io/protractor-helper/
License: MIT License
I've selected for refactoring 7 lines of code which are duplicated in 2 file(s) (1, 2, 3). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! π
Here's the gist of this guideline:
You can find more info about this guideline in Building Maintainable Software. π
βΉοΈ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the π² next to them. The risk profile below the candidates signals (β ) when it's enough! π
Good luck and happy coding! β¨ π―
FYI, @PauloGoncalvesBH.
The idea is to make it more accessible for Brazilians and other Portuguese speakers that don't speak English.
Today it shows something like Failed: element with locator 'undefined' is not visible
.
@PauloGoncalvesBH, maybe you can take a look at it.
Here is a test example:
fit("foo", () => {
const fooEl = element(by.cssContainingText('foo', 'foo'))
protractorHelper.waitForElementVisibility(fooEl)
});
Describe the bug
The setTimeout method work only to the following methods:
Expected behavior
Expected to work to any method.
Is your feature request related to a problem? Please describe.
I couldn't find in existing functions like to check if the element has class
Describe the solution you'd like
It would be good if something to check for the class present in an element like waitForClassToBePresentInElement
The CHANGELOG.md file needs to be updated with more useful information, and less useless info.
Here are some ideas:
We could also update the
README.md
file with a link to theCHANGELOG.md
file, and then have a call-to-action like: "Interested in the latest version of protractor-helper? Take a look at our changelog."
To better organize code responsibilities, we could have a file called messageBuilder.js
, for instance, which could live together with utils.js
(I mean, in the same directory of it). Actually, we would migrate some of the functions from util.js
to this new file, and leave there other utility functionalities, such as requiredParam
and waitForElementToBeClickable.
Now that we have an index.d.ts
file, it would be nice to have some documentation around it so that users without a notion of types could benefit from it while reading the docs.
The functions getBodyElementFromCurrentBrowserOrBrowserInstance
and openNewBrowserInTheSamePage
will soon be deprecated, so we need to implement a mechanism to warn users about it.
This will require research on how to do it.
Such an implementation can be useful for future changes as well.
Do we have options of validating the table data ? using these helpers like finding how many rows table has and so on....
Remember to update the link of https://github.com/wlsf82/protractor-helper/blob/master/docs/EXAMPLES.md#examples
Since we have a messageBuilder
module, we could move all the strings of the deprecation functions to this module, import this module where the messages are needed, and use them there.
This way we would be better in separating responsibilities.
Cc: @PauloGoncalvesBH.
Describe the bug
I'm using protractorHelper for non angular website with cucumber js. I have set the value of waitForAngularEnabled to false, now I've observed that sometimes it gives error Error: function timed out, ensure the promise resolves within 5000 milliseconds
for wait condition
Actual Error
Then I add new clinical item with name "test new clinical item" # src\clinical-items-builder\step-definitions\clinical-items-builder.steps.js:38
Error: function timed out, ensure the promise resolves within 5000 milliseconds
Wait condition
protractorHelper.waitForElementVisibility(element(by.css('.someclass');
Desktop (please complete the following information):
Hi!
I have the problem, that I use protractor AND protractor-helper as dependencies. npm 3+ is not installing protractor, because it's peer dependency from protractor-helper.
Only working solutions:
Can it be removed as peer dependency? Everbody knows that it's needed.
I've selected for refactoring 6 lines of code which are duplicated in 1 file(s) (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! π
Here's the gist of this guideline:
You can find more info about this guideline in Building Maintainable Software. π
βΉοΈ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the π² next to them. The risk profile below the candidates signals (β ) when it's enough! π
Good luck and happy coding! β¨ π―
The release number will be 4.1.10
Also, remember to update the translated version (docs/PT-BR/README.md
).
It'd be nice if protractor-helper had a method to wait for an alert to be present, so that I wouldn't need to write something like:
browser.wait(protractor.ExpectedConditions.alertIsPresent(), 5000);
Instead, I'd write something like:
protractorHelper.waitForAlertPresence()
or protractorHelper.waitForAlertToBePresent()
.
How we can list all new methods on the summary in README.md?
Comments:
Example:
click is a new method of clickWhenClickable without errorMessage parameter.
The clickWhenClickable will be deprecated on a future version.
It's important to be clear to the user.
I think that the better option is the 1.
Due to the Control Flow being removed from the newer version of the Selenium Webdriver (v.4), and the new beta version of Protractor (v.6.0.0-beta) being in accordance with such a change, protractor-helper needs to be adapted to work this way as well. Without it, at some point, it will break.
I have already started working on this (https://github.com/wlsf82/protractor-helper/tree/prepare-protractor-helper-to-work-with-async-await).
For reference read the following: https://github.com/angular/protractor/blob/selenium4/CHANGELOG.md
We will need to update the documentation (notification of deprecations, instructions regarding migration to async/await, retro-compatibility), implement deprecation warnings, and test retro-compatibility with other projects using the lib (we could use some of our own projects for this).
This is a follow-up issue based on the following comment #97 (comment).
The missing method needs to be added on both default and PT-BR/
README.md
files.
Also, let's confirm if any other doc files refer to other methods, but not to this one.
This intends to address "writing shorter units of code" (code quality practice from BetterCodeHub).
Regarding the separation of concerns, we could work with files for:
isCurrentUrlDifferentFromBaseUrl
, setTimeout
).master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
This would help us regarding a "quality" metric on npmjs.org, and it would be another point of contact between our users and us.
Just as references: https://itnext.io/increasing-an-npm-packages-search-score-fb557f859300, https://npmsearch.com/?q=protractor-helper, https://garris.github.io/BackstopJS/
The idea is to increase the code coverage to ease the maintainers' job. The point is that when changing existing functionalities, to check that failures still work as expected, the existing "happy path" tests need to be manually updated and tested, to confirm that failures still work as expected. This is a waste of time when we know that such a process can be automated.
We need to investigate how to test it. Maybe we should have unit tests for it.
I've selected inputFieldInteractions.js:src/inputFieldInteractions.js for refactoring, which is a unit of 20 lines of code. Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Short Units of Code guideline rating! π
Here's the gist of this guideline:
You can find more info about this guideline in Building Maintainable Software. π
βΉοΈ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the π² next to them. The risk profile below the candidates signals (β ) when it's enough! π
Good luck and happy coding! β¨ π―
There's no much sense in testing getters, which is basically what the message builder tests are doing, and so it would be better to remove them all, which would reduce the codebase and also remove unnecessary complexity.
@PauloGoncalvesBH, what do you think?
I've selected for refactoring 6 lines of code which are duplicated in 1 file(s) (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! π
Here's the gist of this guideline:
You can find more info about this guideline in Building Maintainable Software. π
βΉοΈ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the π² next to them. The risk profile below the candidates signals (β ) when it's enough! π
Good luck and happy coding! β¨ π―
FYI, @PauloGoncalvesBH.
Objective:
Validate locally if the commit message respect the conventional commit specification. Using git hooks commit-msg
.
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
As a follow up on #24, seems that we forgot to add the deprecation warning for the openNewBrowserInTheSamePage()
function.
Now that the translation to PT-BR is finished, it'd be nice to have a section on the English version of it, mentioning the PT-BR one.
The idea here is to keep units small and better separate concerns.
I've selected for refactoring 7 lines of code which are duplicated in 2 file(s) (1, 2). Addressing this will make our codebase more maintainable and improve Better Code Hub's Write Code Once guideline rating! π
Here's the gist of this guideline:
You can find more info about this guideline in Building Maintainable Software. π
βΉοΈ To know how many other refactoring candidates need addressing to get a guideline compliant, select some by clicking on the π² next to them. The risk profile below the candidates signals (β ) when it's enough! π
Good luck and happy coding! β¨ π―
Here's where you can find the outdated info https://github.com/wlsf82/protractor-helper/blob/master/index.md#credits.
And here's the updated one https://github.com/wlsf82/protractor-helper#credits.
In the future, if we happen to translate the docs to other languages, the Portuguese version will already be there as an example.
To stop a bad practice that is occurring with the helper, we must remove the errorMessage argument from the methods.
The existing error message in the methods is already clear, pointing out the error line and suggesting what may have occurred. The user choosing which error message should appear is ultimately detrimental to it.
A deprecation warning must be implemented and we must have a transitional period.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.