Skip to content

Commit

Permalink
Version 2.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
welbert committed Dec 10, 2016
1 parent 586da16 commit 9ddb6a8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ After this steps, the css selector will be copied to your clipboard
[back to top](#guideautomator)

---
## Firefox extension
#### Firefox extension
---
You can use the firefox addon to make easy the construction of blocks

[Guide-automator-addon](https://addons.mozilla.org/en-US/firefox/addon/guide-automator/)

![Context](https://addons.cdn.mozilla.net/user-media/previews/full/180/180647.png?modified=1480797935)

[back to top](#guideautomator)

---
Expand Down Expand Up @@ -207,65 +209,65 @@ Params: `<Required>` `[Optional]`
- [sleep](#sleep)
- [console.print](#consoleprint)
## get
### get
- Description: Url to access
- Params: `<url>`
- Example:
- get('https://github.com/welbert');
## click
### click
- Description: Click on element
- Params: `<cssSelector>`
- Example:
- click('.unstarred > button:nth-child(2)');
## clickByLinkText
### clickByLinkText
- Description: Click on link text(\<a\>)
- Params: `<linkText>`
- Example:
- clickByLinkText('README.md');
## takeScreenshot
### takeScreenshot
- Description: Take Screenshot
- Params: `[imageWidth]`
- Example:
- takeScreenshot();
- takeScreenshot('10%');
## takeScreenshotOf
### takeScreenshotOf
- Description: Take Screenshot of specific element
- Params: `<cssSelector>`, `[crop]`, `[outline]`, `[imageWidth]`
- Example:
- takeScreenshotOf('#user-content-guideautomator');
- takeScreenshotOf('#user-content-guideautomator',false,true);
- takeScreenshotOf(['#user-content-guideautomator','.avatar'],false,true); //Multiple cssSelector only for outline

## fillIn
### fillIn
- Description: Fill in field element
- Params: `<cssSelector>`, `<input>`
- Example:
- fillIn('.header-search-input','guide-automator');
## submit
### submit
- Description: Submit a form
- Params: `<cssSelector>`
- Example:
- submit('.js-site-search-form');

## wait
### wait
- Description: Wait element load on page
- Params: `<cssSelector>`, `[timeOut]`
- Example:
- wait('.commit-author-section');
- wait('.commit-author-section',2000);
## sleep
### sleep
- Description: Sleep for a while
- Params: `<milleseconds>`
- Example:
- sleep(1000);

## console.print
### console.print
- Description: Print text on markdown file using javascript blocks
- Params: `<text>`
- Example:
Expand All @@ -274,7 +276,7 @@ Params: `<Required>` `[Optional]`
[back to top](#guideautomator)
---
# Using GD.driver
## Using GD.driver
---
_This topic is for more complex cases or personal needs that guide-automator not support_
Expand All @@ -286,6 +288,8 @@ GD.driver.actions().
perform();
```
See [raw](https://raw.githubusercontent.com/Allan1/guide-automator/master/examples/driver-example.md)
[Selenium Documentation](https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/chrome_exports_Driver.html)
[back to top](#guideautomator)
24 changes: 24 additions & 0 deletions examples/driver-example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is an example of GD.Driver

```javascript
get('https://welbert.github.io/click.html');
takeScreenshot();

sleep(1000);
GD.driver.actions().
mouseMove({x:455, y:213}).
click().
perform();

takeScreenshot();
sleep(1000);

GD.driver.actions().
mouseMove({x:92, y:25}).
click().
perform();

takeScreenshot();
```
### This is a simple example, but you can use the driver to other things
See more [Selenium Documentation](https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/chrome_exports_Driver.html)
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "guide-automator",
"version": "2.1.9",
"version": "2.1.10",
"description": "User guide automator",
"preferGlobal": true,
"bin": {
Expand Down Expand Up @@ -34,8 +34,8 @@
"commander": "^2.9.0",
"express": "^4.14.0",
"gm": "^1.23.0",
"selenium-webdriver": "^3.0.1",
"showdown": "^1.5.0",
"selenium-webdriver": "3.0.1",
"showdown": "^1.5.1",
"wkhtmltopdf": "^0.3.3"
},
"engines": {
Expand Down

0 comments on commit 9ddb6a8

Please sign in to comment.