Skip to content

Update readme #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/robotframework-pageobjectlibrary.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7,295 changes: 7,295 additions & 0 deletions LICENSE.chromedriver

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions PageObjectLibrary/pageobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

from selenium.webdriver.support.expected_conditions import staleness_of
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By


import six

Expand Down
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,40 @@ PageObjectLibrary is a lightweight [Robot Framework] keyword library that makes
```bash
pip install --upgrade robotframework-pageobjectlibrary
```
## Install python

## Source Code
Python 3.12.3

The source code is hosted on GitHub at the following url:
## Install Chrome driver
Get [chrome driver](https://developer.chrome.com/docs/chromedriver/downloads) which is suitable with the machine

* https://github.com/boakley/robotframework-pageobjectlibrary.git

## Running the Demo

In the GitHub repository is a small demonstration suite that includes a self-contained webserver and web site.
In the repository is a small demonstration suite that includes a self-contained webserver and web site.

For the demo to run, you must have [robotframework](https://pypi.org/project/robotframework/) 2.9+ and [robotframework-seleniumlibrary](https://pypi.org/project/robotframework-seleniumlibrary/) installed. You must also have cloned the GitHub repository to have access to the demo files.

## Download pip:
pip <https://pip.pypa.io>
get -pip.py
py -m pip

## Install robotframework-pageobjectlibrary

pip install --upgrade robotframework-pageobjectlibrary
install --upgrade robotframework-pageobjectlibrary
install robotframework-pageobjectlibrary
py -m pip install --upgrade robotframework-pageobjectlibrary

## Install requirement

py -m pip install install -r requirements.txt

## Install selenium

py -m pip install selenium==4.2.0

To run the demo, clone the GitHub repository, cd to the folder that contains this file, and then run the following command: :

```bash
Expand Down
Binary file added chromedriver.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion demo/resources/HomePage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HomePage(PageObject):
page should be"
"""

PAGE_TITLE = "Home - PageObjectLibrary Demo"
PAGE_TITLE = "Cryptocurrency Market | Coin Prices & Market Cap | Tokenize Xchange11"
PAGE_URL = "/"

# these are accessible via dot notaton with self.locator
Expand Down
23 changes: 14 additions & 9 deletions demo/resources/LoginPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,32 @@


class LoginPage(PageObject):
PAGE_TITLE = "Login - PageObjectLibrary Demo"
PAGE_URL = "/login.html"
PAGE_TITLE = "Tokenize Xchange | Digital Currency Trading Platform"
PAGE_URL = "/login?redirectUrl=https://tokenize-dev.com/sso-callback"

# these are accessible via dot notaton with self.locator
# (eg: self.locator.username, etc)
_locators = {
"username": "id=id_username",
"password": "id=id_password",
"submit_button": "id=id_submit",
"welcome_back_text": "//h4[text()='Welcome Back']",
"we_are_so_excited_to_see_you_again": "//p[contains(., 'We are so excited to see you again.')]",
"email": "//label[text()='Email']/following-sibling::div//input[@type='text']",
"password": "//label[text()='Password']/following-sibling::div//input[@type='password']",
"submit_button": "//button[.//p[text()='Log In']]"
}

def log_in_page_should_show_welcome_text(self):
config = BuiltIn().get_variable_value("${CONFIG}")

def login_as_a_normal_user(self):
config = BuiltIn().get_variable_value("${CONFIG}")
self.enter_username(config.username)
self.enter_email(config.email)
self.enter_password(config.password)
with self._wait_for_page_refresh():
self.click_the_submit_button()

def enter_username(self, username):
"""Enter the given string into the username field"""
self.selib.input_text(self.locator.username, username)
def enter_email(self, email):
"""Enter the given string into the email field"""
self.selib.input_text(self.locator.email, email)

def enter_password(self, password):
"""Enter the given string into the password field"""
Expand Down
9 changes: 5 additions & 4 deletions demo/resources/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ def __init__(self):
sys.path.insert(0, os.path.abspath(os.path.join(_here)))

self.demo_root = os.path.abspath(os.path.join(_here, ".."))
self.port = 8000
self.root_url = "http://localhost:%s" % self.port
self.username = "test user"
self.password = "password"
# self.port = 8000
self.root_url = "https://tokenize-dev.com/%s"
self.email = "kimie@tokenize.exchange"
self.password = "1234567Aa@"

def __str__(self):
return "<Config: %s>" % str(self.__dict__)


# This creates a variable that robot can see
CONFIG = Config()

2 changes: 2 additions & 0 deletions demo/tests/demo.robot
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Library PageObjectLibrary
Library SeleniumLibrary
Library Process


Suite Setup Start webapp and open browser
Suite Teardown Stop webapp and close all browsers

Expand All @@ -27,6 +28,7 @@ Start webapp and open browser
Login smoke test
[Setup] Go to page LoginPage
Login as a normal user
Sleep 5
The current page should be HomePage

Login with valid credentials
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
robotframework
robotframework-seleniumlibrary
selenium
selenium==4.2.0
six
2 changes: 2 additions & 0 deletions tests/about.robot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The browser 'about:' page
... Displays the browser's 'about:' page

[Setup] open browser about: ${BROWSER}
Maximize Browser Window


capture page screenshot

Expand Down