Skip to content

Commit

Permalink
Merge branch 'trunk' into sadik-feature-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sadik312 authored Dec 22, 2024
2 parents 38aa219 + df6fabb commit ec26159
Show file tree
Hide file tree
Showing 9 changed files with 726 additions and 419 deletions.
652 changes: 565 additions & 87 deletions examples/javascript/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"selenium-webdriver": "4.27.0"
},
"devDependencies": {
"mocha": "10.8.2"
"mocha": "11.0.1"
}
}
2 changes: 1 addition & 1 deletion examples/kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<kotlin.version>2.0.21</kotlin.version>

<slf4j.version>2.0.16</slf4j.version>
<logback.version>1.5.12</logback.version>
<logback.version>1.5.14</logback.version>

<junit5.version>5.11.4</junit5.version>
<wdm.version>5.2.3</wdm.version>
Expand Down
80 changes: 74 additions & 6 deletions examples/python/tests/browsers/test_internet_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,82 @@ def test_basic_options_win11():

driver.quit()

@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_file_upload_timeout():
options = webdriver.IeOptions()
options.file_upload_timeout = 2000

driver = webdriver.Ie(options=options)

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_ensure_clean_session():
options = webdriver.IeOptions()
options.ensure_clean_session = True

driver = webdriver.Ie(options=options)

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_ignore_zoom_level():
options = webdriver.IeOptions()
options.ignore_zoom_level = True

driver = webdriver.Ie(options=options)

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_ignore_protected_mode_settings():
options = webdriver.IeOptions()
options.ignore_protected_mode_settings = True

driver = webdriver.Ie(options=options)

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_silent():
service = webdriver.IeService(service_args=["--silent"])
driver = webdriver.Ie(service=service)

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_cmd_options():
options = webdriver.IeOptions()
options.add_argument("-private")

driver = webdriver.Ie(options=options)

driver.quit()

# Skipping this as it fails on Windows because the value of registry setting in
# HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth must be '0'
@pytest.mark.skip
def test_force_create_process_api():
options = webdriver.IeOptions()
options.force_create_process_api = True

driver = webdriver.Ie(options=options)

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_log_to_file(log_path):
service = webdriver.IeService(log_output=log_path, log_level='INFO')
service = webdriver.IeService(log_output=log_path, log_level="INFO")

driver = webdriver.Ie(service=service)

with open(log_path, 'r') as fp:
with open(log_path, "r") as fp:
assert "Starting WebDriver server" in fp.readline()

driver.quit()
Expand All @@ -50,19 +118,19 @@ def test_log_to_stdout(capfd):

@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_log_level(log_path):
service = webdriver.IeService(log_output=log_path, log_level='WARN')
service = webdriver.IeService(log_output=log_path, log_level="WARN")

driver = webdriver.Ie(service=service)

with open(log_path, 'r') as fp:
assert 'Started InternetExplorerDriver server (32-bit)' in fp.readline()
with open(log_path, "r") as fp:
assert "Started InternetExplorerDriver server (32-bit)" in fp.readline()

driver.quit()


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
def test_supporting_files(temp_dir):
service = webdriver.IeService(service_args=["–extract-path="+temp_dir])
service = webdriver.IeService(service_args=["–extract-path=" + temp_dir])

driver = webdriver.Ie(service=service)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,8 @@ InternetExplorerOptions options = new InternetExplorerOptions();
options.waitForUploadDialogUpTo(Duration.ofSeconds(2));
WebDriver driver = new RemoteWebDriver(options);
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.file_upload_dialog_timeout = 2000
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L28-L29" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
var options = new InternetExplorerOptions();
Expand Down Expand Up @@ -150,16 +142,8 @@ InternetExplorerOptions options = new InternetExplorerOptions();
options.destructivelyEnsureCleanSession();
WebDriver driver = new RemoteWebDriver(options);
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.ensure_clean_session = True
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L38-L39" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
var options = new InternetExplorerOptions();
Expand Down Expand Up @@ -198,16 +182,8 @@ InternetExplorerOptions options = new InternetExplorerOptions();
options.ignoreZoomSettings();
WebDriver driver = new RemoteWebDriver(options);
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.ignore_zoom_level = True
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L48-L49" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
var options = new InternetExplorerOptions();
Expand Down Expand Up @@ -256,16 +232,8 @@ InternetExplorerOptions options = new InternetExplorerOptions();
options.introduceFlakinessByIgnoringSecurityDomains();
WebDriver driver = new RemoteWebDriver(options);
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.ignore_protected_mode_settings = True
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L58-L59" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
var options = new InternetExplorerOptions();
Expand Down Expand Up @@ -303,16 +271,8 @@ InternetExplorerOptions options = new InternetExplorerOptions();
options.setCapability("silent", true);
WebDriver driver = new InternetExplorerDriver(options);
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.set_capability("silent", True)
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L68-L69" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
InternetExplorerOptions options = new InternetExplorerOptions();
Expand Down Expand Up @@ -400,17 +360,8 @@ public class ieTest {
}
}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.add_argument('-private')
options.force_create_process_api = True
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L76-L79" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
using System;
Expand Down Expand Up @@ -495,16 +446,8 @@ public class ieTest {
}
}
{{< /tab >}}
{{< tab header="Python" >}}
from selenium import webdriver

options = webdriver.IeOptions()
options.force_create_process_api = True
driver = webdriver.Ie(options=options)

driver.get("http://www.google.com")

driver.quit()
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L87-L90" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
using System;
Expand Down Expand Up @@ -575,8 +518,8 @@ To change the logging output to save to a specific file:
Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\
Property value: String representing path to log file
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L29" >}}
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L97-L99" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-implementation >}}
Expand Down Expand Up @@ -605,9 +548,9 @@ To change the logging output to display in the console as STDOUT:
Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\
Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR`
{{% /tab %}}
{{< tab header="Python" >}}
{{< tab header="Python" text=true >}}
{{< badge-version version="4.11" >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L109-L111" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< badge-implementation >}}
Expand Down Expand Up @@ -635,8 +578,8 @@ If logging output is specified, the default level is `FATAL`
Property key: `InternetExplorerDriverService.IE_DRIVER_LOGLEVEL_PROPERTY`\
Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.toString()` enum
{{% /tab %}}
{{< tab header="Python" >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L53" >}}
{{< tab header="Python" text=true >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L121-L123" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}}
Expand All @@ -662,9 +605,9 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t
Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\
Property value: String representing path to supporting files directory
{{< /tab >}}
{{< tab header="Python" >}}
{{< tab header="Python" text=true >}}
{{< badge-version version="4.11" >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}}
{{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L133-L135" >}}
{{< /tab >}}
{{< tab header="CSharp" >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}}
Expand Down
Loading

0 comments on commit ec26159

Please sign in to comment.