From ddb0277613aa2efc6f7a27a54263b60d1538e744 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 19 Sep 2019 03:34:48 -0400 Subject: [PATCH 1/6] Update console scripts: "seleniumbase mkdir DIR" --- seleniumbase/console_scripts/sb_mkdir.py | 41 ++---------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/seleniumbase/console_scripts/sb_mkdir.py b/seleniumbase/console_scripts/sb_mkdir.py index 58eb959d475..8222ef8e9dc 100755 --- a/seleniumbase/console_scripts/sb_mkdir.py +++ b/seleniumbase/console_scripts/sb_mkdir.py @@ -196,41 +196,6 @@ def main(): file.writelines("\r\n".join(data)) file.close() - data = [] - data.append("from seleniumbase import BaseCase") - data.append("from .bing_objects import Page") - data.append("") - data.append("") - data.append("class BingTests(BaseCase):") - data.append("") - data.append(" def test_bing(self):") - data.append(" self.open('https://bing.com')") - data.append(" self.assert_text('Bing', Page.logo_box)") - data.append(" self.update_text(Page.search_box, 'github')") - data.append(" self.assert_element('li[query=\"github\"]')") - data.append(" self.click(Page.search_button)") - data.append( - " self.assert_text('github.com', Page.search_results)") - data.append(" self.click_link_text('Images')") - data.append(" self.assert_element('img[alt*=\"github\"]')") - data.append("") - file_path = "%s/%s" % (dir_name_3, "bing_test.py") - file = codecs.open(file_path, "w+", "utf-8") - file.writelines("\r\n".join(data)) - file.close() - - data = [] - data.append("class Page(object):") - data.append(" logo_box = '#sbox div[class*=logo]'") - data.append(" search_box = 'input.b_searchbox'") - data.append(" search_button = 'input[name=\"go\"]'") - data.append(" search_results = '#b_results'") - data.append("") - file_path = "%s/%s" % (dir_name_3, "bing_objects.py") - file = codecs.open(file_path, "w+", "utf-8") - file.writelines("\r\n".join(data)) - file.close() - data = [] data.append("from seleniumbase import BaseCase") data.append("from .google_objects import HomePage, ResultsPage") @@ -250,10 +215,7 @@ def main(): data.append( " self.assert_text('github.com', " "ResultsPage.search_results)") - data.append(" self.click_link_text('Images')") - data.append(" source = self.get_page_source()") - data.append( - " self.assert_true('Image result for github' in source)") + data.append(" self.assert_element(ResultsPage.images_link)") data.append("") file_path = "%s/%s" % (dir_name_3, "google_test.py") file = codecs.open(file_path, "w+", "utf-8") @@ -273,6 +235,7 @@ def main(): data.append("") data.append("class ResultsPage(object):") data.append(" google_logo = 'img[alt=\"Google\"]'") + data.append(" images_link = 'link=Images'") data.append(" search_results = 'div#center_col'") data.append("") file_path = "%s/%s" % (dir_name_3, "google_objects.py") From c921c896db36522f0ecf7e8bd52454089abd9f1e Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 19 Sep 2019 03:36:48 -0400 Subject: [PATCH 2/6] Update the seleniumbase page objects tool --- seleniumbase/utilities/selenium_ide/objectify.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/seleniumbase/utilities/selenium_ide/objectify.py b/seleniumbase/utilities/selenium_ide/objectify.py index e64e08f2228..2fc4409444a 100755 --- a/seleniumbase/utilities/selenium_ide/objectify.py +++ b/seleniumbase/utilities/selenium_ide/objectify.py @@ -1314,9 +1314,15 @@ def main(shell_command): object_name = "%s.%s" % (str(key), str(pair[0])) object_dict[object_name] = pair[1] + good_sel_dict = {} + aa, bb, cc = scan_objects_file() + for s_key in selector_dict.keys(): + if s_key in bb: + good_sel_dict[s_key] = selector_dict[s_key] + if shell_command == "inject-objects" or shell_command == "objectify": seleniumbase_lines, page_selectors, changed = process_test_file( - code_lines, selector_dict=selector_dict, add_comments=add_comments) + code_lines, selector_dict=good_sel_dict, add_comments=add_comments) added_classes = [] for item in changed: if item not in added_classes: From c172fc73fdc499e1d6054a38ce31910fcfe9cae5 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 19 Sep 2019 03:38:01 -0400 Subject: [PATCH 3/6] Update test samples --- examples/boilerplates/samples/bing_objects.py | 10 ---------- examples/boilerplates/samples/bing_test.py | 19 ------------------- .../boilerplates/samples/google_objects.py | 1 + examples/boilerplates/samples/google_test.py | 4 +--- 4 files changed, 2 insertions(+), 32 deletions(-) delete mode 100755 examples/boilerplates/samples/bing_objects.py delete mode 100755 examples/boilerplates/samples/bing_test.py diff --git a/examples/boilerplates/samples/bing_objects.py b/examples/boilerplates/samples/bing_objects.py deleted file mode 100755 index baf65d36a0b..00000000000 --- a/examples/boilerplates/samples/bing_objects.py +++ /dev/null @@ -1,10 +0,0 @@ -''' -Bing.com page objects as CSS selectors -''' - - -class Page(object): - logo_box = '#sbox div[class*=logo]' - search_box = 'input.b_searchbox' - search_button = 'input[name="go"]' - search_results = '#b_results' diff --git a/examples/boilerplates/samples/bing_test.py b/examples/boilerplates/samples/bing_test.py deleted file mode 100755 index 9811b3f758e..00000000000 --- a/examples/boilerplates/samples/bing_test.py +++ /dev/null @@ -1,19 +0,0 @@ -''' -Bing.com testing example -''' - -from seleniumbase import BaseCase -from .bing_objects import Page - - -class BingTests(BaseCase): - - def test_bing(self): - self.open('https://bing.com') - self.assert_text('Bing', Page.logo_box) - self.update_text(Page.search_box, 'github') - self.assert_element('li[query="github"]') - self.click(Page.search_button) - self.assert_text('github.com', Page.search_results) - self.click_link_text('Images') - self.assert_element('img[alt="Image result for github"]') diff --git a/examples/boilerplates/samples/google_objects.py b/examples/boilerplates/samples/google_objects.py index acdc092a41e..712bbef1249 100755 --- a/examples/boilerplates/samples/google_objects.py +++ b/examples/boilerplates/samples/google_objects.py @@ -13,4 +13,5 @@ class HomePage(object): class ResultsPage(object): google_logo = 'img[alt="Google"]' + images_link = 'link=Images' search_results = 'div#center_col' diff --git a/examples/boilerplates/samples/google_test.py b/examples/boilerplates/samples/google_test.py index 80c400dd1c7..29b3e0acd11 100755 --- a/examples/boilerplates/samples/google_test.py +++ b/examples/boilerplates/samples/google_test.py @@ -16,6 +16,4 @@ def test_google_dot_com(self): self.assert_element(HomePage.feeling_lucky_button) self.click(HomePage.search_button) self.assert_text('github.com', ResultsPage.search_results) - self.click_link_text('Images') - source = self.get_page_source() - self.assert_true("Image result for github" in source) + self.assert_element(ResultsPage.images_link) From c40a1fdd2b6eb67909f246e9865dfdd9b8c7ebc4 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 19 Sep 2019 03:40:22 -0400 Subject: [PATCH 4/6] Update twine version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0054cd9b355..0cb626716f9 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ os.system('rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl') os.system('python setup.py sdist bdist_wheel') # Create new tar/wheel print("\n*** Installing twine: *** (Required for PyPI uploads)\n") - os.system("python -m pip install 'twine>=1.14.0'") + os.system("python -m pip install 'twine>=1.15.0'") print("\n*** Publishing The Release to PyPI: ***\n") os.system('python -m twine upload dist/*') # Requires ~/.pypirc Keys print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n") From 5fb9cb4dcc8aa1b6d95492c5f54d3b48c73906e0 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 19 Sep 2019 03:43:40 -0400 Subject: [PATCH 5/6] Update ReadMe files --- README.md | 20 +++++++++----------- integrations/google_cloud/ReadMe.md | 2 +- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 36e9b43dfbf..02f8d190be8 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [ ](https://github.com/seleniumbase/SeleniumBase/releases) [ ](https://dev.azure.com/seleniumbase/seleniumbase/_build/latest?definitionId=1&branchName=master) [ ](https://travis-ci.org/seleniumbase/SeleniumBase) [ ](https://gitter.im/seleniumbase/SeleniumBase) [ ](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [ ](https://github.com/seleniumbase/SeleniumBase/stargazers)
-All-in-one testing framework for automated E2E tests, [assisted-QA](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md), and [website tours](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md). +All-in-one framework for automated E2E testing, [assisted-QA](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md), and [website tours](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
(Above: [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) from [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) running in demo mode, which adds JavaScript for highlighting page actions.)
@@ -12,23 +12,21 @@ pytest my_first_test.py --demo_mode SeleniumBase uses [pytest](https://github.com/pytest-dev/pytest) for running Python scripts, while using [Selenium WebDriver](https://www.seleniumhq.org/) for controlling web browsers. -## Get Started: +## Get Started: -### Install Python: +### Install ``Python``: [ ](https://www.python.org/downloads/) -**[python.org/downloads/](https://www.python.org/downloads/)** -[ ](https://www.python.org/downloads/) +Get it from **[python.org/downloads](https://www.python.org/downloads/)** and add Python to your System PATH. -### Install/upgrade ``pip``: +### Upgrade ``pip``: -With Python installed and on your System PATH, you can get the latest ``pip`` with: ```bash python -m easy_install -U pip ``` -### Setup a Python Virtual Env: +### Create a Python Virtual Env: -It is **recommended** to use a **Python Virtual Environment** to isolate Python dependencies between projects. Instructions on creating one can be found **[here](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md)**. (Learn more about virtual environments on the **[official site](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/)**.) +It is **recommended** to use a **Python Virtual Environment** to isolate Python dependencies between projects. Instructions on creating one can be found **[HERE](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md)**. (Learn more about virtual environments on the **[official site](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/)**.) ### Install ``seleniumbase``: [ ](https://pypi.python.org/pypi/seleniumbase) ```bash @@ -599,7 +597,7 @@ If the web page you're on already has jQuery loaded, you can start executing jQu You'd know this because the web page would contain something like the following in the HTML: ```html - + ``` It's OK if you want to use jQuery on a page that doesn't have it loaded yet. To do so, run the following command first: @@ -714,4 +712,4 @@ If you see something, say something! We are very active in resolving issues. [ -[](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
[ ](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) +[](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
[ ](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) diff --git a/integrations/google_cloud/ReadMe.md b/integrations/google_cloud/ReadMe.md index 6df79465468..a89cec39853 100755 --- a/integrations/google_cloud/ReadMe.md +++ b/integrations/google_cloud/ReadMe.md @@ -1,6 +1,6 @@ ### Building a browser-based test automation server on the [Google Cloud Platform](https://cloud.google.com/) by using [SeleniumBase](https://github.com/seleniumbase/SeleniumBase) -(This tutorial, [from a previous GCP Meetup live demo](http://www.meetup.com/Boston-Google-Cloud-Meetup/events/230839686/?showDescription=true), will teach you how to setup a Linux server for running automated browser tests. The cost of running this server is [$14.20/month on Google Cloud](https://console.cloud.google.com/launcher/details/bitnami-launchpad/jenkins) (enough to handle **6 parallel tests**). This is amazingly **20 times LESS expensive** than using competitors such as [BrowserStack](https://www.browserstack.com/pricing) or [Sauce Labs](https://saucelabs.com/pricing) **for the SAME number of parallel tests**.) +(This tutorial, [from a previous Google Cloud Meetup](http://www.meetup.com/Boston-Google-Cloud-Meetup/events/230839686/?showDescription=true), will teach you how to setup a Linux server for running automated browser tests. The cost of running this server is about [$13.61/month on Google Cloud](https://console.cloud.google.com/launcher/details/bitnami-launchpad/jenkins) (enough to handle **6 parallel tests**). This is much less expensive than using competitors such as [BrowserStack](https://www.browserstack.com/pricing) or [Sauce Labs](https://saucelabs.com/pricing) **for the SAME number of parallel tests**.) #### Step 1. Open the Google Cloud Platform Cloud Launcher From 3e3cb88885a5190b23c4a45b79f81f8a5acf2432 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 19 Sep 2019 03:45:17 -0400 Subject: [PATCH 6/6] Version 1.32.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0cb626716f9..a9f6547ca63 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ setup( name='seleniumbase', - version='1.32.1', + version='1.32.2', description='Fast, Easy, and Reliable Browser Automation & Testing.', long_description=long_description, long_description_content_type='text/markdown',