Skip to content

Commit 0df878e

Browse files
authored
Merge pull request #635 from seleniumbase/update-console-scripts
Update console scripts: "seleniumbase mkdir [DIR]" (and more)
2 parents fe08a93 + 8789ec9 commit 0df878e

File tree

18 files changed

+197
-7
lines changed

18 files changed

+197
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pip-log.txt
3838
# Unit test / coverage reports
3939
.coverage
4040
.tox
41+
coverage.xml
4142
nosetests.xml
4243

4344
# py.test
@@ -84,7 +85,9 @@ report.html
8485
report.xml
8586

8687
# Allure Reports / Results
88+
allure_report
8789
allure-report
90+
allure_results
8891
allure-results
8992

9093
# Presentations

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ seleniumbase install chromedriver
8888
seleniumbase install chromedriver latest
8989
```
9090

91+
(See [seleniumbase.io/seleniumbase/console_scripts/ReadMe/](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) for more information on SeleniumBase console scripts, such as ``seleniumbase install`` and ``seleniumbase mkdir``.)
92+
9193
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Run a test on Chrome:</h3>
9294

9395
```bash
@@ -429,6 +431,14 @@ nosetests test_suite.py --report
429431

430432
(NOTE: You can add ``--show-report`` to immediately display Nosetest reports after the test suite completes. Only use ``--show-report`` when running tests locally because it pauses the test run.)
431433

434+
<h4><b>Allure Reports:</b></h4>
435+
436+
See: [https://docs.qameta.io/allure/](https://docs.qameta.io/allure/#_pytest)
437+
438+
```bash
439+
pytest test_suite.py --alluredir=allure_results
440+
```
441+
432442

433443
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Using a Proxy Server:</h3>
434444

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ipdb==0.13.3
1010
jedi==0.17.2
1111
idna==2.10
1212
chardet==3.0.4
13-
urllib3==1.25.9
13+
urllib3==1.25.10
1414
requests==2.24.0
1515
selenium==3.141.0
1616
pluggy==0.13.1
@@ -43,7 +43,7 @@ coverage==5.2
4343
pyotp==2.3.0
4444
boto==2.49.0
4545
cffi==1.14.0
46-
rich==3.3.2;python_version>="3.6" and python_version<"4.0"
46+
rich==3.4.1;python_version>="3.6" and python_version<"4.0"
4747
flake8==3.7.9;python_version<"3.5"
4848
flake8==3.8.3;python_version>="3.5"
4949
pyflakes==2.1.1;python_version<"3.5"

seleniumbase/console_scripts/ReadMe.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ file name while keeping the original file intact.
9090
Works with Katalon Recorder scripts.
9191
See: http://www.katalon.com/automation-recorder
9292

93+
### print
94+
95+
* Usage:
96+
``sbase print [FILE] [OPTIONS]``
97+
98+
* Options:
99+
``-n`` (Add line Numbers to the rows)
100+
``-w`` (Use word-Wrap for long lines)
101+
102+
* Output:
103+
Prints the code/text of any file
104+
with syntax-highlighting.
105+
93106
### translate
94107

95108
* Usage:
@@ -174,6 +187,24 @@ Reverts the changes made by ``seleniumbase objectify ...`` or
174187
seleniumbase Python file. Objects will get replaced by
175188
selectors stored in the "page_objects.py" file.
176189

190+
### encrypt / obfuscate
191+
192+
* Usage:
193+
``sbase encrypt`` OR ``sbase obfuscate``
194+
195+
* Output:
196+
Runs the password encryption/obfuscation tool.
197+
(Where you can enter a password to encrypt/obfuscate.)
198+
199+
### decrypt / unobfuscate
200+
201+
* Usage:
202+
``sbase decrypt`` OR ``sbase unobfuscate``
203+
204+
* Output:
205+
Runs the password decryption/unobfuscation tool.
206+
(Where you can enter an encrypted password to decrypt.)
207+
177208
### download
178209

179210
* Usage:

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,104 @@ def main():
119119
file.writelines("\r\n".join(data))
120120
file.close()
121121

122+
data = []
123+
data.append("")
124+
file_path = "%s/%s" % (dir_name, "__init__.py")
125+
file = codecs.open(file_path, "w+", "utf-8")
126+
file.writelines("\r\n".join(data))
127+
file.close()
128+
129+
data = []
130+
data.append("*.py[cod]")
131+
data.append("*.egg")
132+
data.append("*.egg-info")
133+
data.append("dist")
134+
data.append("build")
135+
data.append("ghostdriver.log")
136+
data.append("eggs")
137+
data.append("parts")
138+
data.append("bin")
139+
data.append("var")
140+
data.append("sdist")
141+
data.append("develop-eggs")
142+
data.append(".installed.cfg")
143+
data.append("lib")
144+
data.append("lib64")
145+
data.append("__pycache__")
146+
data.append("env")
147+
data.append("venv")
148+
data.append("sbase")
149+
data.append("sbase*")
150+
data.append("pyvenv.cfg")
151+
data.append(".Python")
152+
data.append("include")
153+
data.append("pip-delete-this-directory.txt")
154+
data.append("pip-selfcheck.json")
155+
data.append("ipython.1.gz")
156+
data.append("nosetests.1")
157+
data.append("pip-log.txt")
158+
data.append(".swp")
159+
data.append(".coverage")
160+
data.append(".tox")
161+
data.append("coverage.xml")
162+
data.append("nosetests.xml")
163+
data.append(".cache/*")
164+
data.append(".pytest_cache/*")
165+
data.append(".pytest_config")
166+
data.append("junit")
167+
data.append("test-results.xml")
168+
data.append(".idea")
169+
data.append(".project")
170+
data.append(".pydevproject")
171+
data.append(".vscode")
172+
data.append("chromedriver")
173+
data.append("geckodriver")
174+
data.append("msedgedriver")
175+
data.append("operadriver")
176+
data.append("MicrosoftWebDriver.exe")
177+
data.append("IEDriverServer.exe")
178+
data.append("chromedriver.exe")
179+
data.append("geckodriver.exe")
180+
data.append("msedgedriver.exe")
181+
data.append("operadriver.exe")
182+
data.append("logs")
183+
data.append("latest_logs")
184+
data.append("log_archives")
185+
data.append("archived_logs")
186+
data.append("geckodriver.log")
187+
data.append("pytestdebug.log")
188+
data.append("latest_report")
189+
data.append("report_archives")
190+
data.append("archived_reports")
191+
data.append("html_report.html")
192+
data.append("report.html")
193+
data.append("report.xml")
194+
data.append("allure_report")
195+
data.append("allure-report")
196+
data.append("allure_results")
197+
data.append("allure-results")
198+
data.append("presentations_saved")
199+
data.append("saved_presentations")
200+
data.append("tours_exported")
201+
data.append("images_exported")
202+
data.append("saved_cookies")
203+
data.append("visual_baseline")
204+
data.append("selenium-server-standalone.jar")
205+
data.append("proxy.zip")
206+
data.append("verbose_hub_server.dat")
207+
data.append("verbose_node_server.dat")
208+
data.append("ip_of_grid_hub.dat")
209+
data.append("downloaded_files")
210+
data.append("archived_files")
211+
data.append("assets")
212+
data.append("temp")
213+
data.append("temp*")
214+
data.append("node_modules")
215+
file_path = "%s/%s" % (dir_name, ".gitignore")
216+
file = codecs.open(file_path, "w+", "utf-8")
217+
file.writelines("\r\n".join(data))
218+
file.close()
219+
122220
data = []
123221
data.append("from seleniumbase import BaseCase")
124222
data.append("")

seleniumbase/plugins/pytest_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def pytest_addoption(parser):
239239
Format: A comma-separated string with the 3 values.
240240
Example: "375,734,3"
241241
Default: None. (Will use default values if None)""")
242-
parser.addoption('--extension_zip', '--extension-zip',
242+
parser.addoption('--extension_zip', '--extension-zip', '--crx',
243243
action='store',
244244
dest='extension_zip',
245245
default=None,

seleniumbase/plugins/selenium_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def options(self, parser, env):
144144
Example: "375,734,3"
145145
Default: None. (Will use default values if None)""")
146146
parser.add_option(
147-
'--extension_zip', '--extension-zip',
147+
'--extension_zip', '--extension-zip', '--crx',
148148
action='store',
149149
dest='extension_zip',
150150
default=None,

seleniumbase/translate/chinese.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ def 切换到警报(self, *args, **kwargs):
437437
# switch_to_alert(timeout=None)
438438
return self.switch_to_alert(*args, **kwargs)
439439

440+
def 拖放(self, *args, **kwargs):
441+
# drag_and_drop(drag_selector, drop_selector)
442+
return self.drag_and_drop(*args, **kwargs)
443+
440444
def 加载HTML文件(self, *args, **kwargs):
441445
# load_html_file(html_file, new_page=True)
442446
return self.load_html_file(*args, **kwargs)

seleniumbase/translate/dutch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ def overschakelen_naar_waarschuwing(self, *args, **kwargs):
437437
# switch_to_alert(timeout=None)
438438
return self.switch_to_alert(*args, **kwargs)
439439

440+
def slepen_en_neerzetten(self, *args, **kwargs):
441+
# drag_and_drop(drag_selector, drop_selector)
442+
return self.drag_and_drop(*args, **kwargs)
443+
440444
def html_bestand_laden(self, *args, **kwargs):
441445
# load_html_file(html_file, new_page=True)
442446
return self.load_html_file(*args, **kwargs)

seleniumbase/translate/french.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,10 @@ def passer_à_alerte(self, *args, **kwargs):
437437
# switch_to_alert(timeout=None)
438438
return self.switch_to_alert(*args, **kwargs)
439439

440+
def glisser_et_déposer(self, *args, **kwargs):
441+
# drag_and_drop(drag_selector, drop_selector)
442+
return self.drag_and_drop(*args, **kwargs)
443+
440444
def charger_html_fichier(self, *args, **kwargs):
441445
# load_html_file(html_file, new_page=True)
442446
return self.load_html_file(*args, **kwargs)

0 commit comments

Comments
 (0)