Skip to content

Commit

Permalink
Fix grammar errors and some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
codegenic-works committed Dec 17, 2020
1 parent 4701cc1 commit b5b16ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# seleniumgenic
Utilities to improve projects that utilize [selenium-webdriver](https://www.selenium.dev/selenium/docs/api/javascript/index.html). Provides foundational classes for Page and Page Component Objects to help modularize and organize code which leads to improved readbility, maintainability, and reusability. Also provides other utilies to aid in common tasks/scenarios.
Utilities to improve projects that utilize [selenium-webdriver](https://www.selenium.dev/selenium/docs/api/javascript/index.html). Provides foundational classes for Page and Page Component Objects to help modularize and organize code which leads to improved readability, maintainability, and reusability. Also provides other utilities to aid in common tasks/scenarios.

Implemented in an unopinionated way providing an an easy to understand and use API.
Implemented in an un-opinionated way providing an easy to understand and use API.

# Install

Expand Down Expand Up @@ -140,7 +140,7 @@ const LoginPage = Require('./login-page');

# Details

`seleniumgenic` has zero dependencies. It mearly takes in a given Selenium [WebDriver](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html) instance and works with it's API. Since the suites of core Selenium packages are constantly updating and only work with the latest versions of browsers, it will be the aim to keep `seleniumgenic` always working with the latest versions of the [selenium-webdriver](https://www.selenium.dev/selenium/docs/api/javascript/index.html).
`seleniumgenic` has zero dependencies. It just takes in a given Selenium [WebDriver](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html) instance and works with it's API. Since the suites of core Selenium packages are constantly updating and only work with the latest versions of browsers, it will be the aim to keep `seleniumgenic` always working with the latest versions of the [selenium-webdriver](https://www.selenium.dev/selenium/docs/api/javascript/index.html).

## Component Objects

Expand Down Expand Up @@ -174,7 +174,7 @@ Clicks this Component.

### contextClick() => Promise<undefined>

Performs a contenxt/right click on this Component.
Performs a context/right click on this Component.

### createComponent(props) => Component

Expand Down Expand Up @@ -224,7 +224,7 @@ Gets the Components HTML tag name.

Gets the text contained within this Component. The default is to get the text as it is visually displayed to the user. The 'raw' flag can be used to ge the text as it is provided to the HTML of the page.

- `raw`: Boolean, flag that indicates if the text shoudl be retrieved in its raw form.
- `raw`: Boolean, flag that indicates if the text should be retrieved in its raw form.

### hoverClick() => Promise<undefined>

Expand Down Expand Up @@ -264,25 +264,25 @@ Takes a screenshot of visible area of this Component and returns the base-64 enc

Waits until the Component is displayed.

- `timeout`: The max amout of time (ms) to wait for the condition to be true. Optional, default is 10000.
- `timeout`: The max amount of time (ms) to wait for the condition to be true. Optional, default is 10000.

### waitUntilIsEnabled(timeout = 10000) => Promise<undefined>

Waits until the Component is enabled.

- `timeout`: The max amout of time (ms) to wait for the condition to be true. Optional, default is 10000.
- `timeout`: The max amount of time (ms) to wait for the condition to be true. Optional, default is 10000.

### waitUntilIsPresent(timeout = 10000) => Promise<undefined>

Waits until the Component is present.

- `timeout`: The max amout of time (ms) to wait for the condition to be true. Optional, default is 10000.
- `timeout`: The max amount of time (ms) to wait for the condition to be true. Optional, default is 10000.

### waitUntilIsSelected(timeout = 10000) => Promise<undefined>

Waits until the Component is selected.

- `timeout`: The max amout of time (ms) to wait for the condition to be true. Optional, default is 10000.
- `timeout`: The max amount of time (ms) to wait for the condition to be true. Optional, default is 10000.

## Page Objects

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seleniumgenic",
"version": "1.0.1",
"version": "1.0.2",
"description": "Utilities to improve projects that utilize selenium-webdriver",
"main": "index.js",
"repository": {
Expand Down
18 changes: 9 additions & 9 deletions src/component-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class Component {
* });
*/
constructor({ driver, by, scope = driver, webElement }) {
if (!driver) throw new Error('A driver must be provied to create a Component');
if (!webElement && !by) throw new Error('Either the "webElement" or "by" property must be provied to create a Component');
if (!driver) throw new Error('A driver must be provided to create a Component');
if (!webElement && !by) throw new Error('Either the "webElement" or "by" property must be provided to create a Component');

this._element = webElement;
this._driver = driver;
Expand Down Expand Up @@ -51,7 +51,7 @@ class Component {
}

/**
* Performs a contenxt/right click on this Component.
* Performs a context/right click on this Component.
* @returns {Promise<undefined>}
*/
contextClick() {
Expand Down Expand Up @@ -263,15 +263,15 @@ class Component {
/**
* Takes a screenshot of visible area of this Component.
* @param {Boolean} [scroll] Indicates if the Component should be scrolled into view to take the screenshot.
* @returns {Promsie<String>} Resolves to the base-64 encoded PNG.
* @returns {Promise<String>} Resolves to the base-64 encoded PNG.
*/
takeScreenshot(scroll) {
return this.element.takeScreenshot(scroll);
}

/**
* Waits until the Component is displayed.
* @param {Number} [timeout=10000] The max amout of time (ms) to wait for the condition to be true.
* @param {Number} [timeout=10000] The max amount of time (ms) to wait for the condition to be true.
* @returns {Promise<undefined>}
*/
async waitUntilIsDisplayed(timeout = 10000) {
Expand All @@ -281,8 +281,8 @@ class Component {

/**
* Waits until the Component is enabled.
* @param {Number} [timeout=10000] The max amout of time (ms) to wait for the condition to be true.
* @returns {Promsie<undefined>}
* @param {Number} [timeout=10000] The max amount of time (ms) to wait for the condition to be true.
* @returns {Promise<undefined>}
*/
async waitUntilIsEnabled(timeout = 10000) {
const self = this;
Expand All @@ -291,7 +291,7 @@ class Component {

/**
* Wait until the Component is present.
* @param {Number} [timeout=10000] The max amout of time (ms) to wait for the condition to be true.
* @param {Number} [timeout=10000] The max amount of time (ms) to wait for the condition to be true.
* @returns {Promise<undefined>}
*/
async waitUntilIsPresent(timeout = 10000) {
Expand All @@ -301,7 +301,7 @@ class Component {

/**
* Wait until the Component is selected.
* @param {Number} [timeout=10000] The max amout of time (ms) to wait for the condition to be true.
* @param {Number} [timeout=10000] The max amount of time (ms) to wait for the condition to be true.
* @returns {Promise<undefined>}
*/
async waitUntilIsSelected(timeout = 10000) {
Expand Down

0 comments on commit b5b16ea

Please sign in to comment.