diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cebb0c..8e2d7e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ [//]: <> (The format is based on Keep a Changelog keepachangelog.com/) [//]: <> (and this project adheres to Semantic Versioning semver.org/) +### [2024.40.0] - On 2024.04.05 + +### Added +- Added faker useragent support for chrome browser by default. This default behaviour will change to opt-in feature in upcoming releases. + ### [2024.36.0] - On 2024.03.31 ### Added diff --git a/IDEAS.md b/IDEAS.md index d025046..dc7223a 100644 --- a/IDEAS.md +++ b/IDEAS.md @@ -1,6 +1,8 @@ -| IDEAS | DESCRIPTION | -|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| AWS Automation | Add support for AWS automation in nRoBo framework using official library by AWS. | -| Database Testing | Add support for Database testing by enabling all kinds of database connectors and also ways to execute SQL statements, fetch results etc in uniform way all across various databases. | - | API Testing | Add support for API automation (Dont' know how exactly yet) | - | Compare Database | Research list of libraries for comparing database tables, databases, and many more. Identify tools and libraries and integrate support for the same in the nRoBo framework. | \ No newline at end of file +| IDEAS | DESCRIPTION | +|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| AWS Automation | Add support for AWS automation in nRoBo framework using official library by AWS. | +| Database Testing | Add support for Database testing by enabling all kinds of database connectors and also ways to execute SQL statements, fetch results etc in uniform way all across various databases. | + | API Testing | Add support for API automation (Dont' know how exactly yet) | + | Compare Database | Research list of libraries for comparing database tables, databases, and many more. Identify tools and libraries and integrate support for the same in the nRoBo framework. | + | Mobile Automation| Add support for appium library in nRoBo | + | Jira Automation | Integration Jira to achieve automated ticket creation on failures, posting test results summary in jira, etc through ([Jira API](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#about) and [python module](https://atlassian-python-api.readthedocs.io/index.html)) | \ No newline at end of file diff --git a/README.rst b/README.rst index e06eea1..294a29e 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ Following pre-requisites needs to be installed in order to run ***nRoBo*** frame java --version 2. Install allure command line tool. - - Check `Install guide `_ + - Check `Install guide `_ - Run the following command to check if allure cli is installed .. code-block:: bash @@ -352,105 +352,105 @@ Features - Percent - Download Count * - US - - 39.39% - - 22,502 + - 38.96% + - 23,088 * - CN - - 13.15% - - 7,511 + - 13.06% + - 7,741 * - DE - - 5.83% - - 3,330 + - 6.48% + - 3,838 * - SG - - 5.30% - - 3,025 + - 5.58% + - 3,308 * - RU - - 5.18% - - 2,962 + - 5.17% + - 3,064 * - HK - - 4.24% - - 2,420 + - 4.13% + - 2,449 * - JP - - 3.17% - - 1,810 + - 3.10% + - 1,834 * - FR - - 2.90% - - 1,657 + - 2.83% + - 1,677 * - KR - - 2.78% - - 1,589 + - 2.72% + - 1,611 * - CA - - 2.73% - - 1,557 + - 2.67% + - 1,583 * - NO - - 1.99% - - 1,137 + - 2.00% + - 1,183 * - GB - - 1.88% - - 1,072 + - 1.84% + - 1,091 * - AU - - 1.79% - - 1,023 + - 1.75% + - 1,039 * - IN - 1.52% - - 869 + - 901 * - SE - - 1.23% - - 702 + - 1.21% + - 716 * - TH - - 0.80% - - 458 - * - HR - 0.79% - - 452 + - 466 + * - HR + - 0.78% + - 462 * - DK - - 0.69% + - 0.67% - 395 * - IE - 0.66% - - 375 + - 389 * - TW - - 0.64% + - 0.61% - 363 * - IL - - 0.56% - - 321 + - 0.58% + - 341 * - NL - - 0.52% + - 0.50% - 297 * - ES - - 0.46% + - 0.44% - 262 * - CH - - 0.43% - - 244 + - 0.42% + - 251 * - AE - 0.35% - - 201 + - 207 + * - CZ + - 0.24% + - 144 * - FI - 0.16% - - 91 + - 93 * - ZA - - 0.16% + - 0.15% - 89 * - BR - 0.13% - 77 * - PL - - 0.11% + - 0.10% - 61 * - TR - - 0.08% + - 0.07% - 44 * - CW - - 0.08% - - 44 - * - IS - 0.07% - - 42 - * - CZ + - 44 + * - OM - 0.07% - 42 - * - OM + * - IS - 0.07% - 42 * - RO @@ -468,10 +468,10 @@ Features * - DZ - 0.01% - 4 - * - AR + * - EE - 0.01% - 3 - * - EE + * - AR - 0.01% - 3 * - SK @@ -488,5 +488,5 @@ Features - 1 * - **Total** - **100.00%** - - **57,129** + - **59,255** diff --git a/conftest.py b/conftest.py index 54d5cc7..7fb2034 100644 --- a/conftest.py +++ b/conftest.py @@ -266,6 +266,25 @@ def password(request): return request.config.getoption(f"--{nCLI.PASSWORD}") +def get_fake_user_agents(): + """ + Get fake user agents at random + """ + from fake_useragent import UserAgent + + _browsers = ['chrome', 'edge', 'firefox', 'safari'] + _os = ["windows", "macos", "linux", "android", "ios"] + _platform = ["pc", "mobile", "tablet"] + + _browser_name = [_browsers[Common.generate_random_numbers(0, 3)]] + _os_name = [_os[Common.generate_random_numbers(0, 4)]] + _platform_name = [_platform[Common.generate_random_numbers(0, 2)]] + + return UserAgent(browsers=_browser_name, + os=_os_name, + platforms=_platform_name).random + + @pytest.fixture(autouse=True, scope='function') def driver(request): """ @@ -364,17 +383,7 @@ def driver(request): # URL: https://www.zenrows.com/blog/selenium-avoid-bot-detection#how-anti-bots-work _driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})") - # Initializing a list with two Useragents - useragentarray = [ - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36", - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36", - ] - - for i in range(len(useragentarray)): - # Setting user agent iteratively as Chrome 108 and 107 - _driver.execute_cdp_cmd("Network.setUserAgentOverride", {"userAgent": useragentarray[i]}) - print(_driver.execute_script("return navigator.userAgent;")) - # _driver.get("https://www.httpbin.org/headers") + _driver.execute_cdp_cmd("Network.setUserAgentOverride", {"userAgent": get_fake_user_agents()}) elif browser == Browsers.CHROME_HEADLESS: """if browser requested is chrome""" diff --git a/key/download-stats/2024_03_31_6101.md b/key/download-stats/2024_03_31/2024_03_31_6101.md similarity index 100% rename from key/download-stats/2024_03_31_6101.md rename to key/download-stats/2024_03_31/2024_03_31_6101.md diff --git a/key/download-stats/2024_04_01/2024_04_01_3070.md b/key/download-stats/2024_04_01/2024_04_01_3070.md new file mode 100644 index 0000000..42848cc --- /dev/null +++ b/key/download-stats/2024_04_01/2024_04_01_3070.md @@ -0,0 +1,54 @@ +Served from cache: False +Data processed: 9.85 GiB +Data billed: 9.85 GiB +Estimated cost: $0.05 + +| country | percent | download_count | +| ------- | ------- | -------------- | +| US | 39.34% | 22,712 | +| CN | 13.09% | 7,556 | +| DE | 6.10% | 3,524 | +| SG | 5.28% | 3,047 | +| RU | 5.19% | 2,996 | +| HK | 4.21% | 2,432 | +| JP | 3.15% | 1,818 | +| FR | 2.88% | 1,664 | +| KR | 2.75% | 1,589 | +| CA | 2.72% | 1,569 | +| NO | 2.00% | 1,155 | +| GB | 1.88% | 1,085 | +| AU | 1.78% | 1,027 | +| IN | 1.52% | 879 | +| SE | 1.23% | 708 | +| TH | 0.79% | 458 | +| HR | 0.79% | 456 | +| DK | 0.68% | 395 | +| IE | 0.66% | 381 | +| TW | 0.63% | 363 | +| IL | 0.56% | 321 | +| NL | 0.51% | 297 | +| ES | 0.45% | 262 | +| CH | 0.43% | 246 | +| AE | 0.35% | 203 | +| FI | 0.16% | 91 | +| ZA | 0.15% | 89 | +| BR | 0.13% | 77 | +| PL | 0.11% | 61 | +| CW | 0.08% | 44 | +| TR | 0.08% | 44 | +| OM | 0.07% | 42 | +| IS | 0.07% | 42 | +| CZ | 0.07% | 42 | +| RO | 0.04% | 24 | +| GF | 0.02% | 10 | +| UA | 0.01% | 8 | +| CY | 0.01% | 6 | +| DZ | 0.01% | 4 | +| AR | 0.01% | 3 | +| EE | 0.01% | 3 | +| SK | 0.00% | 2 | +| MX | 0.00% | 1 | +| PT | 0.00% | 1 | +| RS | 0.00% | 1 | +| Total | | 57,738 | + diff --git a/key/download-stats/2024_04_03/2024_04_03_2937.md b/key/download-stats/2024_04_03/2024_04_03_2937.md new file mode 100644 index 0000000..91eaa7c --- /dev/null +++ b/key/download-stats/2024_04_03/2024_04_03_2937.md @@ -0,0 +1,54 @@ +Served from cache: False +Data processed: 9.89 GiB +Data billed: 9.89 GiB +Estimated cost: $0.05 + +| country | percent | download_count | +| ------- | ------- | -------------- | +| US | 39.08% | 22,848 | +| CN | 13.01% | 7,606 | +| DE | 6.38% | 3,731 | +| SG | 5.25% | 3,070 | +| RU | 5.23% | 3,059 | +| HK | 4.18% | 2,443 | +| JP | 3.13% | 1,830 | +| FR | 2.86% | 1,673 | +| KR | 2.74% | 1,599 | +| CA | 2.70% | 1,579 | +| NO | 2.00% | 1,171 | +| GB | 1.86% | 1,088 | +| AU | 1.78% | 1,039 | +| IN | 1.53% | 895 | +| SE | 1.22% | 712 | +| TH | 0.79% | 460 | +| HR | 0.79% | 460 | +| DK | 0.68% | 395 | +| IE | 0.66% | 385 | +| TW | 0.62% | 363 | +| IL | 0.58% | 341 | +| NL | 0.51% | 297 | +| ES | 0.45% | 262 | +| CH | 0.43% | 250 | +| AE | 0.35% | 207 | +| CZ | 0.25% | 144 | +| FI | 0.16% | 91 | +| ZA | 0.15% | 89 | +| BR | 0.13% | 77 | +| PL | 0.10% | 61 | +| TR | 0.08% | 44 | +| CW | 0.08% | 44 | +| OM | 0.07% | 42 | +| IS | 0.07% | 42 | +| RO | 0.04% | 24 | +| GF | 0.02% | 10 | +| UA | 0.01% | 8 | +| CY | 0.01% | 6 | +| DZ | 0.01% | 4 | +| AR | 0.01% | 3 | +| EE | 0.01% | 3 | +| SK | 0.00% | 2 | +| PT | 0.00% | 1 | +| RS | 0.00% | 1 | +| MX | 0.00% | 1 | +| Total | | 58,460 | + diff --git a/key/download-stats/2024_04_04/2024_04_04_6944.md b/key/download-stats/2024_04_04/2024_04_04_6944.md new file mode 100644 index 0000000..658def5 --- /dev/null +++ b/key/download-stats/2024_04_04/2024_04_04_6944.md @@ -0,0 +1,54 @@ +Served from cache: False +Data processed: 9.96 GiB +Data billed: 9.96 GiB +Estimated cost: $0.05 + +| country | percent | download_count | +| ------- | ------- | -------------- | +| US | 38.81% | 22,931 | +| CN | 13.10% | 7,739 | +| DE | 6.50% | 3,838 | +| SG | 5.60% | 3,308 | +| RU | 5.19% | 3,064 | +| HK | 4.15% | 2,449 | +| JP | 3.10% | 1,834 | +| FR | 2.84% | 1,677 | +| KR | 2.71% | 1,599 | +| CA | 2.68% | 1,583 | +| NO | 2.00% | 1,183 | +| GB | 1.85% | 1,091 | +| AU | 1.76% | 1,039 | +| IN | 1.52% | 901 | +| SE | 1.21% | 716 | +| TH | 0.79% | 464 | +| HR | 0.78% | 462 | +| DK | 0.67% | 395 | +| IE | 0.66% | 389 | +| TW | 0.61% | 363 | +| IL | 0.58% | 341 | +| NL | 0.50% | 297 | +| ES | 0.44% | 262 | +| CH | 0.42% | 251 | +| AE | 0.35% | 207 | +| CZ | 0.24% | 144 | +| FI | 0.16% | 93 | +| ZA | 0.15% | 89 | +| BR | 0.13% | 77 | +| PL | 0.10% | 61 | +| TR | 0.07% | 44 | +| CW | 0.07% | 44 | +| OM | 0.07% | 42 | +| IS | 0.07% | 42 | +| RO | 0.04% | 24 | +| GF | 0.02% | 10 | +| UA | 0.01% | 8 | +| CY | 0.01% | 6 | +| DZ | 0.01% | 4 | +| EE | 0.01% | 3 | +| AR | 0.01% | 3 | +| SK | 0.00% | 2 | +| MX | 0.00% | 1 | +| RS | 0.00% | 1 | +| PT | 0.00% | 1 | +| Total | | 59,082 | + diff --git a/key/download-stats/2024_04_05_4714.md b/key/download-stats/2024_04_05_4714.md new file mode 100644 index 0000000..7a7c46e --- /dev/null +++ b/key/download-stats/2024_04_05_4714.md @@ -0,0 +1,54 @@ +Served from cache: False +Data processed: 9.92 GiB +Data billed: 9.92 GiB +Estimated cost: $0.05 + +| country | percent | download_count | +| ------- | ------- | -------------- | +| US | 38.96% | 23,088 | +| CN | 13.06% | 7,741 | +| DE | 6.48% | 3,838 | +| SG | 5.58% | 3,308 | +| RU | 5.17% | 3,064 | +| HK | 4.13% | 2,449 | +| JP | 3.10% | 1,834 | +| FR | 2.83% | 1,677 | +| KR | 2.72% | 1,611 | +| CA | 2.67% | 1,583 | +| NO | 2.00% | 1,183 | +| GB | 1.84% | 1,091 | +| AU | 1.75% | 1,039 | +| IN | 1.52% | 901 | +| SE | 1.21% | 716 | +| TH | 0.79% | 466 | +| HR | 0.78% | 462 | +| DK | 0.67% | 395 | +| IE | 0.66% | 389 | +| TW | 0.61% | 363 | +| IL | 0.58% | 341 | +| NL | 0.50% | 297 | +| ES | 0.44% | 262 | +| CH | 0.42% | 251 | +| AE | 0.35% | 207 | +| CZ | 0.24% | 144 | +| FI | 0.16% | 93 | +| ZA | 0.15% | 89 | +| BR | 0.13% | 77 | +| PL | 0.10% | 61 | +| TR | 0.07% | 44 | +| CW | 0.07% | 44 | +| OM | 0.07% | 42 | +| IS | 0.07% | 42 | +| RO | 0.04% | 24 | +| GF | 0.02% | 10 | +| UA | 0.01% | 8 | +| CY | 0.01% | 6 | +| DZ | 0.01% | 4 | +| EE | 0.01% | 3 | +| AR | 0.01% | 3 | +| SK | 0.00% | 2 | +| RS | 0.00% | 1 | +| PT | 0.00% | 1 | +| MX | 0.00% | 1 | +| Total | | 59,255 | + diff --git a/nrobo/__init__.py b/nrobo/__init__.py index f3e69a2..76f1f5a 100644 --- a/nrobo/__init__.py +++ b/nrobo/__init__.py @@ -15,7 +15,7 @@ @email: erpanchdev@gmail.com """ -__version__ = '2024.37.0' +__version__ = '2024.40.0' # install rich library import os diff --git a/nrobo/cli/install/requirements.txt b/nrobo/cli/install/requirements.txt index 60e8e64..470bf2a 100644 --- a/nrobo/cli/install/requirements.txt +++ b/nrobo/cli/install/requirements.txt @@ -29,6 +29,8 @@ allure-pytest==2.13.2 pycurl==7.45.3 pypinfo==21.0.0 pytest-emoji==0.2.0 +pytest-check==2.3.1 +fake-useragent==1.5.1 npm==0.1.1 Appium-Python-Client==3.2.1 # test data generators diff --git a/nrobo/selenese/__init__.py b/nrobo/selenese/__init__.py index ccb97a1..5833cc1 100644 --- a/nrobo/selenese/__init__.py +++ b/nrobo/selenese/__init__.py @@ -890,8 +890,8 @@ def submit(self, by: AnyBy, value: Optional[str] = None): def clear_spl(self, by: AnyBy, value: Optional[str] = None): element = self.find_element(by, value) - self.action_chain().click(element).send_keys(Keys.ARROW_LEFT)\ - .double_click(self.find_element(by, value)).send_keys(Keys.DELETE)\ + self.action_chain().click(element).send_keys(Keys.ARROW_LEFT) \ + .double_click(self.find_element(by, value)).send_keys(Keys.DELETE) \ .perform() # self.wait_for_a_while(1) @@ -1139,7 +1139,18 @@ def wait_for_page_to_be_loaded(self): nprint(f"Exception: {ae}", STYLE.HLRed) nprint("End of Wait for page load...", style=STYLE.PURPLE4) - def wait_for_a_while(self, time_in_sec=None): + @staticmethod + def wait(time_in_sec=None): + """ + Pause for + + :param time_in_sec: + :return: + """ + WaitImplementationsNrobo.wait_for_a_while(time_in_sec) + + @staticmethod + def wait_for_a_while(time_in_sec=None): """ Pause for diff --git a/pyproject.toml b/pyproject.toml index 0d6fff7..df7beb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" # Project details [project] name = "nrobo" -version = "2024.37.0" +version = "2024.40.0" authors = [{name="Panchdev Singh Chauhan", email="erpanchdev@gmail.com"}] maintainers = [{name="Panchdev Singh Chauhan", email="erpanchdev@gmail.com"}] description = "Powerful! Yet, Easy to USE! Automated Testing Framework" diff --git a/versions/prod.yaml b/versions/prod.yaml index feaf7f9..6af2c65 100644 --- a/versions/prod.yaml +++ b/versions/prod.yaml @@ -1 +1 @@ -version: 2024.37.0 +version: 2024.40.0 diff --git a/versions/test.yaml b/versions/test.yaml index feaf7f9..6af2c65 100644 --- a/versions/test.yaml +++ b/versions/test.yaml @@ -1 +1 @@ -version: 2024.37.0 +version: 2024.40.0