From 9d27ba9d1d4adb110264e61af12e505f6fd4907f Mon Sep 17 00:00:00 2001 From: Szabo Bogdan Date: Sun, 6 Mar 2016 18:51:33 +0200 Subject: [PATCH 1/2] selenium requests --- .gitignore | 17 +++++++++++++++++ source/{selenium.d => api.d} | 6 +++--- source/session.d | 3 +++ source/test.d | 4 ++-- 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100755 .gitignore rename source/{selenium.d => api.d} (99%) create mode 100644 source/session.d diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..28c6f53 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +.dub +docs.json +__dummy.html +*.o +*.obj + +bin/Debug/selenium + +dub.selections.json + +dub.userprefs + +selenium.dproj + +selenium-d + +selenium diff --git a/source/selenium.d b/source/api.d similarity index 99% rename from source/selenium.d rename to source/api.d index aa269ab..42d5726 100755 --- a/source/selenium.d +++ b/source/api.d @@ -1,4 +1,4 @@ -module selenium; +module selenium.api; import core.vararg; import std.stdio; @@ -235,7 +235,7 @@ struct LogEntry { string message; } -struct SeleniumSession { +struct SeleniumApi { string serverUrl; Capabilities desiredCapabilities; @@ -393,7 +393,7 @@ struct SeleniumSession { return this; } - auto deleteCookie(string name) { + auto deleteCookie(string name) { DELETE("/cookie/" ~ name); return this; } diff --git a/source/session.d b/source/session.d new file mode 100644 index 0000000..4c241ba --- /dev/null +++ b/source/session.d @@ -0,0 +1,3 @@ +module selenium.session; + +import selenium.api; diff --git a/source/test.d b/source/test.d index f05b17d..fbd85b5 100644 --- a/source/test.d +++ b/source/test.d @@ -1,6 +1,6 @@ module test; -import selenium; +import selenium.api; import std.stdio; import vibe.data.json; @@ -10,7 +10,7 @@ unittest { auto url1 = "http://www.amazon.com/All-Light-We-Cannot-See/dp/1476746583/"; auto url2 = "http://www.amazon.com/The-Boys-Boat-Americans-Olympics/dp/0143125478/"; - auto session = SeleniumSession("http://127.0.0.1:4444/wd/hub", Capabilities.chrome); + auto session = SeleniumApi("http://127.0.0.1:4444/wd/hub", Capabilities.chrome); session.timeouts(TimeoutType.script, 10_000); session.timeouts(TimeoutType.implicit, 10_000); From 5de50b9d6fb6fd67b909a5c77fe0c5c1d45b418b Mon Sep 17 00:00:00 2001 From: Szabo Bogdan Date: Sun, 6 Mar 2016 18:53:50 +0200 Subject: [PATCH 2/2] gitignore update --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 28c6f53..01d527d 100755 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ selenium.dproj selenium-d selenium +*.DS_Store