repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.setAppURL | protected static void setAppURL(Selenified clazz, ITestContext context, String siteURL) {
context.setAttribute(clazz.getClass().getName() + APP_URL, siteURL);
} | java | protected static void setAppURL(Selenified clazz, ITestContext context, String siteURL) {
context.setAttribute(clazz.getClass().getName() + APP_URL, siteURL);
} | [
"protected",
"static",
"void",
"setAppURL",
"(",
"Selenified",
"clazz",
",",
"ITestContext",
"context",
",",
"String",
"siteURL",
")",
"{",
"context",
".",
"setAttribute",
"(",
"clazz",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"APP_URL",
"... | Sets the URL of the application under test. If the site was provided as a
system property, this method ignores the passed in value, and uses the
system property.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at... | [
"Sets",
"the",
"URL",
"of",
"the",
"application",
"under",
"test",
".",
"If",
"the",
"site",
"was",
"provided",
"as",
"a",
"system",
"property",
"this",
"method",
"ignores",
"the",
"passed",
"in",
"value",
"and",
"uses",
"the",
"system",
"property",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L106-L108 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getVersion | private String getVersion(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Version");
} | java | private String getVersion(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Version");
} | [
"private",
"String",
"getVersion",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"return",
"(",
"String",
")",
"context",
".",
"getAttribute",
"(",
"clazz",
"+",
"\"Version\"",
")",
";",
"}"
] | Obtains the version of the current test suite being executed. If no
version was set, null will be returned
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context asso... | [
"Obtains",
"the",
"version",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"If",
"no",
"version",
"was",
"set",
"null",
"will",
"be",
"returned"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L121-L123 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.setVersion | protected static void setVersion(Selenified clazz, ITestContext context, String version) {
context.setAttribute(clazz.getClass().getName() + "Version", version);
} | java | protected static void setVersion(Selenified clazz, ITestContext context, String version) {
context.setAttribute(clazz.getClass().getName() + "Version", version);
} | [
"protected",
"static",
"void",
"setVersion",
"(",
"Selenified",
"clazz",
",",
"ITestContext",
"context",
",",
"String",
"version",
")",
"{",
"context",
".",
"setAttribute",
"(",
"clazz",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\"Version\""... | Sets the version of the current test suite being executed.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associated with the test suite, used for
storing app... | [
"Sets",
"the",
"version",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L135-L137 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getAuthor | private String getAuthor(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Author");
} | java | private String getAuthor(String clazz, ITestContext context) {
return (String) context.getAttribute(clazz + "Author");
} | [
"private",
"String",
"getAuthor",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"return",
"(",
"String",
")",
"context",
".",
"getAttribute",
"(",
"clazz",
"+",
"\"Author\"",
")",
";",
"}"
] | Obtains the author of the current test suite being executed. If no author
was set, null will be returned
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associ... | [
"Obtains",
"the",
"author",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"If",
"no",
"author",
"was",
"set",
"null",
"will",
"be",
"returned"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L150-L152 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.setAuthor | protected static void setAuthor(Selenified clazz, ITestContext context, String author) {
context.setAttribute(clazz.getClass().getName() + "Author", author);
} | java | protected static void setAuthor(Selenified clazz, ITestContext context, String author) {
context.setAttribute(clazz.getClass().getName() + "Author", author);
} | [
"protected",
"static",
"void",
"setAuthor",
"(",
"Selenified",
"clazz",
",",
"ITestContext",
"context",
",",
"String",
"author",
")",
"{",
"context",
".",
"setAttribute",
"(",
"clazz",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\"Author\"",
... | Sets the author of the current test suite being executed.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associated with the test suite, used for
storing app ... | [
"Sets",
"the",
"author",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L164-L166 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getExtraHeaders | private static Map<String, Object> getExtraHeaders(String clazz, ITestContext context) {
return (Map<String, Object>) context.getAttribute(clazz + "Headers");
} | java | private static Map<String, Object> getExtraHeaders(String clazz, ITestContext context) {
return (Map<String, Object>) context.getAttribute(clazz + "Headers");
} | [
"private",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"getExtraHeaders",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"return",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"context",
".",
"getAttribute",
"(",
"clazz",
... | Obtains the additional headers of the current test suite being executed. If no additional headers
were set, null will be returned
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - ... | [
"Obtains",
"the",
"additional",
"headers",
"of",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"If",
"no",
"additional",
"headers",
"were",
"set",
"null",
"will",
"be",
"returned"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L179-L181 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.addAdditionalDesiredCapabilities | protected static void addAdditionalDesiredCapabilities(Selenified clazz, ITestContext context, String capabilityName, Object capabilityValue) {
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
if (context.getAttributeNames().contains(clazz.getClass().getName() + DESIRED_CAPABILITIES)... | java | protected static void addAdditionalDesiredCapabilities(Selenified clazz, ITestContext context, String capabilityName, Object capabilityValue) {
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
if (context.getAttributeNames().contains(clazz.getClass().getName() + DESIRED_CAPABILITIES)... | [
"protected",
"static",
"void",
"addAdditionalDesiredCapabilities",
"(",
"Selenified",
"clazz",
",",
"ITestContext",
"context",
",",
"String",
"capabilityName",
",",
"Object",
"capabilityValue",
")",
"{",
"DesiredCapabilities",
"desiredCapabilities",
"=",
"new",
"DesiredCa... | Sets any additional capabilities desired for the browsers. Things like enabling javascript, accepting insecure certs. etc
can all be added here on a per test class basis.
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
u... | [
"Sets",
"any",
"additional",
"capabilities",
"desired",
"for",
"the",
"browsers",
".",
"Things",
"like",
"enabling",
"javascript",
"accepting",
"insecure",
"certs",
".",
"etc",
"can",
"all",
"be",
"added",
"here",
"on",
"a",
"per",
"test",
"class",
"basis",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L209-L216 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getAdditionalDesiredCapabilities | private static DesiredCapabilities getAdditionalDesiredCapabilities(String clazz, ITestContext context) {
return (DesiredCapabilities) context.getAttribute(clazz + DESIRED_CAPABILITIES);
} | java | private static DesiredCapabilities getAdditionalDesiredCapabilities(String clazz, ITestContext context) {
return (DesiredCapabilities) context.getAttribute(clazz + DESIRED_CAPABILITIES);
} | [
"private",
"static",
"DesiredCapabilities",
"getAdditionalDesiredCapabilities",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"return",
"(",
"DesiredCapabilities",
")",
"context",
".",
"getAttribute",
"(",
"clazz",
"+",
"DESIRED_CAPABILITIES",
")",
... | Retrieves the additional desired capabilities set by the current class for the browsers
@param clazz - the test suite class, used for making threadsafe storage of
application, allowing suites to have independent applications
under test, run at the same time
@param context - the TestNG context associated with the tes... | [
"Retrieves",
"the",
"additional",
"desired",
"capabilities",
"set",
"by",
"the",
"current",
"class",
"for",
"the",
"browsers"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L228-L230 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getServiceUserCredential | private static String getServiceUserCredential(String clazz, ITestContext context) {
if (System.getenv("SERVICES_USER") != null) {
return System.getenv("SERVICES_USER");
}
if (context.getAttribute(clazz + SERVICES_USER) != null) {
return (String) context.getAttribute(claz... | java | private static String getServiceUserCredential(String clazz, ITestContext context) {
if (System.getenv("SERVICES_USER") != null) {
return System.getenv("SERVICES_USER");
}
if (context.getAttribute(clazz + SERVICES_USER) != null) {
return (String) context.getAttribute(claz... | [
"private",
"static",
"String",
"getServiceUserCredential",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"if",
"(",
"System",
".",
"getenv",
"(",
"\"SERVICES_USER\"",
")",
"!=",
"null",
")",
"{",
"return",
"System",
".",
"getenv",
"(",
"\... | Obtains the web services username provided for the current test suite being executed. Anything passed in from
the command line will first be taken, to override any other values. Next, values being set in the classes will
be checked for. If neither of these are set, an empty string will be returned
@param clazz - the... | [
"Obtains",
"the",
"web",
"services",
"username",
"provided",
"for",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"Anything",
"passed",
"in",
"from",
"the",
"command",
"line",
"will",
"first",
"be",
"taken",
"to",
"override",
"any",
"other",
"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L244-L253 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.getServicePassCredential | private static String getServicePassCredential(String clazz, ITestContext context) {
if (System.getenv("SERVICES_PASS") != null) {
return System.getenv("SERVICES_PASS");
}
if (context.getAttribute(clazz + SERVICES_PASS) != null) {
return (String) context.getAttribute(claz... | java | private static String getServicePassCredential(String clazz, ITestContext context) {
if (System.getenv("SERVICES_PASS") != null) {
return System.getenv("SERVICES_PASS");
}
if (context.getAttribute(clazz + SERVICES_PASS) != null) {
return (String) context.getAttribute(claz... | [
"private",
"static",
"String",
"getServicePassCredential",
"(",
"String",
"clazz",
",",
"ITestContext",
"context",
")",
"{",
"if",
"(",
"System",
".",
"getenv",
"(",
"\"SERVICES_PASS\"",
")",
"!=",
"null",
")",
"{",
"return",
"System",
".",
"getenv",
"(",
"\... | Obtains the web services password provided for the current test suite being executed. Anything passed in from
the command line will first be taken, to override any other values. Next, values being set in the classes will
be checked for. If neither of these are set, an empty string will be returned
@param clazz - the... | [
"Obtains",
"the",
"web",
"services",
"password",
"provided",
"for",
"the",
"current",
"test",
"suite",
"being",
"executed",
".",
"Anything",
"passed",
"in",
"from",
"the",
"command",
"line",
"will",
"first",
"be",
"taken",
"to",
"override",
"any",
"other",
"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L267-L276 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.loadInitialPage | private void loadInitialPage(App app, String url, Reporter reporter) {
String startingPage = "The initial url of <i>";
String act = "Opening new browser and loading up initial url";
String expected = startingPage + url + "</i> will successfully load";
if (app != null) {
try ... | java | private void loadInitialPage(App app, String url, Reporter reporter) {
String startingPage = "The initial url of <i>";
String act = "Opening new browser and loading up initial url";
String expected = startingPage + url + "</i> will successfully load";
if (app != null) {
try ... | [
"private",
"void",
"loadInitialPage",
"(",
"App",
"app",
",",
"String",
"url",
",",
"Reporter",
"reporter",
")",
"{",
"String",
"startingPage",
"=",
"\"The initial url of <i>\"",
";",
"String",
"act",
"=",
"\"Opening new browser and loading up initial url\"",
";",
"St... | Loads the initial app specified by the url, and ensures the app loads
successfully
@param app - the application to be tested, contains all control elements
@param url - the initial url to load
@param reporter - the output file to write everything to | [
"Loads",
"the",
"initial",
"app",
"specified",
"by",
"the",
"url",
"and",
"ensures",
"the",
"app",
"loads",
"successfully"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L405-L425 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.finish | protected void finish() {
Reporter reporter = this.reporterThreadLocal.get();
assertEquals("Detailed results found at: " + reporter.getFileName(), "0 errors",
Integer.toString(reporter.getFails()) + ERRORS_CHECK);
} | java | protected void finish() {
Reporter reporter = this.reporterThreadLocal.get();
assertEquals("Detailed results found at: " + reporter.getFileName(), "0 errors",
Integer.toString(reporter.getFails()) + ERRORS_CHECK);
} | [
"protected",
"void",
"finish",
"(",
")",
"{",
"Reporter",
"reporter",
"=",
"this",
".",
"reporterThreadLocal",
".",
"get",
"(",
")",
";",
"assertEquals",
"(",
"\"Detailed results found at: \"",
"+",
"reporter",
".",
"getFileName",
"(",
")",
",",
"\"0 errors\"",
... | Concludes each test case. This should be run as the last time of
each @Test. It will close out the output logging file, and count any
errors that were encountered during the test, and fail the test if any
errors were encountered | [
"Concludes",
"each",
"test",
"case",
".",
"This",
"should",
"be",
"run",
"as",
"the",
"last",
"time",
"of",
"each"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L459-L463 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/Selenified.java | Selenified.setupScreenSize | private void setupScreenSize(App app) {
String screensize = app.getBrowser().getScreensize();
if (screensize != null) {
if (screensize.matches("(\\d+)x(\\d+)")) {
int width = Integer.parseInt(screensize.split("x")[0]);
int height = Integer.parseInt(screensize.... | java | private void setupScreenSize(App app) {
String screensize = app.getBrowser().getScreensize();
if (screensize != null) {
if (screensize.matches("(\\d+)x(\\d+)")) {
int width = Integer.parseInt(screensize.split("x")[0]);
int height = Integer.parseInt(screensize.... | [
"private",
"void",
"setupScreenSize",
"(",
"App",
"app",
")",
"{",
"String",
"screensize",
"=",
"app",
".",
"getBrowser",
"(",
")",
".",
"getScreensize",
"(",
")",
";",
"if",
"(",
"screensize",
"!=",
"null",
")",
"{",
"if",
"(",
"screensize",
".",
"mat... | Sets up the initial size of the browser. Checks for the passed in parameter of screensize. If set to width
x height, sets the browser to that size; if set to maximum, maximizes the browser.
@param app - the application to be tested, contains all control elements | [
"Sets",
"up",
"the",
"initial",
"size",
"of",
"the",
"browser",
".",
"Checks",
"for",
"the",
"passed",
"in",
"parameter",
"of",
"screensize",
".",
"If",
"set",
"to",
"width",
"x",
"height",
"sets",
"the",
"browser",
"to",
"that",
"size",
";",
"if",
"se... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/Selenified.java#L485-L498 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.init | private void init(WebDriver driver, Reporter reporter) {
this.driver = driver;
this.reporter = reporter;
App app = null;
if (reporter != null) {
app = reporter.getApp();
}
is = new Is(this);
get = new Get(app, driver, this);
verifyState = new... | java | private void init(WebDriver driver, Reporter reporter) {
this.driver = driver;
this.reporter = reporter;
App app = null;
if (reporter != null) {
app = reporter.getApp();
}
is = new Is(this);
get = new Get(app, driver, this);
verifyState = new... | [
"private",
"void",
"init",
"(",
"WebDriver",
"driver",
",",
"Reporter",
"reporter",
")",
"{",
"this",
".",
"driver",
"=",
"driver",
";",
"this",
".",
"reporter",
"=",
"reporter",
";",
"App",
"app",
"=",
"null",
";",
"if",
"(",
"reporter",
"!=",
"null",... | A private method to finish setting up each element
@param driver - the selenium web driver, the underlying way all actions and
assertions are controlled
@param reporter - the TestOutput file. This is provided by the
SeleniumTestBase functionality | [
"A",
"private",
"method",
"to",
"finish",
"setting",
"up",
"each",
"element"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L215-L238 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.prettyOutputStart | private String prettyOutputStart(String initialString) {
initialString += Reporter.ordinal(match + 1) + " element with <i>" + type.toString() + "</i> of <i>" + locator + "</i>";
if (parent != null) {
initialString = parent.prettyOutputStart(initialString + " and parent of ");
}
... | java | private String prettyOutputStart(String initialString) {
initialString += Reporter.ordinal(match + 1) + " element with <i>" + type.toString() + "</i> of <i>" + locator + "</i>";
if (parent != null) {
initialString = parent.prettyOutputStart(initialString + " and parent of ");
}
... | [
"private",
"String",
"prettyOutputStart",
"(",
"String",
"initialString",
")",
"{",
"initialString",
"+=",
"Reporter",
".",
"ordinal",
"(",
"match",
"+",
"1",
")",
"+",
"\" element with <i>\"",
"+",
"type",
".",
"toString",
"(",
")",
"+",
"\"</i> of <i>\"",
"+... | Builds the nicely HTML formatted output of the element by retrieving parent
element information
@param initialString - the starting string, typically describing the element,
or initial parent element
@return String: text identifying how the element was located | [
"Builds",
"the",
"nicely",
"HTML",
"formatted",
"output",
"of",
"the",
"element",
"by",
"retrieving",
"parent",
"element",
"information"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L312-L318 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.defineByElement | public By defineByElement() {
// consider adding strengthening
By byElement = null;
switch (type) { // determine which locator type we are interested in
case XPATH:
byElement = By.xpath(locator);
break;
case ID:
byElement = ... | java | public By defineByElement() {
// consider adding strengthening
By byElement = null;
switch (type) { // determine which locator type we are interested in
case XPATH:
byElement = By.xpath(locator);
break;
case ID:
byElement = ... | [
"public",
"By",
"defineByElement",
"(",
")",
"{",
"// consider adding strengthening",
"By",
"byElement",
"=",
"null",
";",
"switch",
"(",
"type",
")",
"{",
"// determine which locator type we are interested in",
"case",
"XPATH",
":",
"byElement",
"=",
"By",
".",
"xp... | Determines Selenium's 'By' object using Webdriver
@return By: the Selenium object | [
"Determines",
"Selenium",
"s",
"By",
"object",
"using",
"Webdriver"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L502-L532 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.getWebElement | public WebElement getWebElement() {
List<WebElement> elements = getWebElements();
if (elements.size() > match) {
return elements.get(match);
}
String reason = this.prettyOutputStart() + " was not located on the page";
if( !elements.isEmpty() ) {
reason += ... | java | public WebElement getWebElement() {
List<WebElement> elements = getWebElements();
if (elements.size() > match) {
return elements.get(match);
}
String reason = this.prettyOutputStart() + " was not located on the page";
if( !elements.isEmpty() ) {
reason += ... | [
"public",
"WebElement",
"getWebElement",
"(",
")",
"{",
"List",
"<",
"WebElement",
">",
"elements",
"=",
"getWebElements",
"(",
")",
";",
"if",
"(",
"elements",
".",
"size",
"(",
")",
">",
"match",
")",
"{",
"return",
"elements",
".",
"get",
"(",
"matc... | Retrieves the identified matching web element using Webdriver. Use this
sparingly, only when the action you want to perform on the element isn't
available, as commands from it won't be checked, logged, caught, or
screenshotted.
@return WebElement: the element object, and all associated values with it | [
"Retrieves",
"the",
"identified",
"matching",
"web",
"element",
"using",
"Webdriver",
".",
"Use",
"this",
"sparingly",
"only",
"when",
"the",
"action",
"you",
"want",
"to",
"perform",
"on",
"the",
"element",
"isn",
"t",
"available",
"as",
"commands",
"from",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L542-L552 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.getWebElements | public List<WebElement> getWebElements() {
if (parent != null) {
return parent.getWebElement().findElements(defineByElement());
}
return driver.findElements(defineByElement());
} | java | public List<WebElement> getWebElements() {
if (parent != null) {
return parent.getWebElement().findElements(defineByElement());
}
return driver.findElements(defineByElement());
} | [
"public",
"List",
"<",
"WebElement",
">",
"getWebElements",
"(",
")",
"{",
"if",
"(",
"parent",
"!=",
"null",
")",
"{",
"return",
"parent",
".",
"getWebElement",
"(",
")",
".",
"findElements",
"(",
"defineByElement",
"(",
")",
")",
";",
"}",
"return",
... | Retrieves all matching web elements using Webdriver. Use this sparingly,
only when the action you want to perform on the element isn't available,
as commands from it won't be checked, logged, caught, or screenshotted.
@return List: a list of WebElement objects, and all associated values
with them | [
"Retrieves",
"all",
"matching",
"web",
"elements",
"using",
"Webdriver",
".",
"Use",
"this",
"sparingly",
"only",
"when",
"the",
"action",
"you",
"want",
"to",
"perform",
"on",
"the",
"element",
"isn",
"t",
"available",
"as",
"commands",
"from",
"it",
"won",... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L562-L567 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.findChild | public Element findChild(Element child) {
return new Element(child.getDriver(), reporter, child.getType(), child.getLocator(), child.getMatch(), this);
} | java | public Element findChild(Element child) {
return new Element(child.getDriver(), reporter, child.getType(), child.getLocator(), child.getMatch(), this);
} | [
"public",
"Element",
"findChild",
"(",
"Element",
"child",
")",
"{",
"return",
"new",
"Element",
"(",
"child",
".",
"getDriver",
"(",
")",
",",
"reporter",
",",
"child",
".",
"getType",
"(",
")",
",",
"child",
".",
"getLocator",
"(",
")",
",",
"child",... | Searches for a child element within the element, and creates and returns
this new child element
@param child - the child element to search for within the element
@return Element: the full reference to the child element element | [
"Searches",
"for",
"a",
"child",
"element",
"within",
"the",
"element",
"and",
"creates",
"and",
"returns",
"this",
"new",
"child",
"element"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L576-L578 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotInput | private boolean isNotInput(String action, String expected, String extra) {
// wait for element to be displayed
if (!is.input()) {
reporter.fail(action, expected, extra + prettyOutput() + NOT_AN_INPUT);
// indicates element not an input
return true;
}
r... | java | private boolean isNotInput(String action, String expected, String extra) {
// wait for element to be displayed
if (!is.input()) {
reporter.fail(action, expected, extra + prettyOutput() + NOT_AN_INPUT);
// indicates element not an input
return true;
}
r... | [
"private",
"boolean",
"isNotInput",
"(",
"String",
"action",
",",
"String",
"expected",
",",
"String",
"extra",
")",
"{",
"// wait for element to be displayed",
"if",
"(",
"!",
"is",
".",
"input",
"(",
")",
")",
"{",
"reporter",
".",
"fail",
"(",
"action",
... | Determines if the element is an input.
@param action - what action is occurring
@param expected - what is the expected result
@param extra - what actually is occurring
@return Boolean: is the element enabled? | [
"Determines",
"if",
"the",
"element",
"is",
"an",
"input",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L658-L666 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isSelect | private boolean isSelect(String action, String expected) {
// wait for element to be displayed
if (!is.select()) {
reporter.fail(action, expected, Element.CANT_SELECT + prettyOutput() + NOT_A_SELECT);
// indicates element not an input
return false;
}
r... | java | private boolean isSelect(String action, String expected) {
// wait for element to be displayed
if (!is.select()) {
reporter.fail(action, expected, Element.CANT_SELECT + prettyOutput() + NOT_A_SELECT);
// indicates element not an input
return false;
}
r... | [
"private",
"boolean",
"isSelect",
"(",
"String",
"action",
",",
"String",
"expected",
")",
"{",
"// wait for element to be displayed",
"if",
"(",
"!",
"is",
".",
"select",
"(",
")",
")",
"{",
"reporter",
".",
"fail",
"(",
"action",
",",
"expected",
",",
"E... | Determines if the element is a select.
@param action - what action is occurring
@param expected - what is the expected result
@return Boolean: is the element enabled? | [
"Determines",
"if",
"the",
"element",
"is",
"a",
"select",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L675-L683 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresentDisplayedEnabled | private boolean isNotPresentDisplayedEnabled(String action, String expected, String extra) {
// wait for element to be present
if (isNotPresent(action, expected, extra)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, extra)) ... | java | private boolean isNotPresentDisplayedEnabled(String action, String expected, String extra) {
// wait for element to be present
if (isNotPresent(action, expected, extra)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, extra)) ... | [
"private",
"boolean",
"isNotPresentDisplayedEnabled",
"(",
"String",
"action",
",",
"String",
"expected",
",",
"String",
"extra",
")",
"{",
"// wait for element to be present",
"if",
"(",
"isNotPresent",
"(",
"action",
",",
"expected",
",",
"extra",
")",
")",
"{",... | Determines if something is present, displayed, and enabled. This returns
true if all three are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected result
@param extra - what actually is occurring
@return Boolean: is the element present, displayed, and ... | [
"Determines",
"if",
"something",
"is",
"present",
"displayed",
"and",
"enabled",
".",
"This",
"returns",
"true",
"if",
"all",
"three",
"are",
"true",
"otherwise",
"it",
"returns",
"false"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L694-L705 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresentEnabledInput | private boolean isNotPresentEnabledInput(String action, String expected) {
// wait for element to be present
if (isNotPresent(action, expected, Element.CANT_TYPE)) {
return true;
}
// wait for element to be enabled
return isNotEnabled(action, expected, Element.CANT_TY... | java | private boolean isNotPresentEnabledInput(String action, String expected) {
// wait for element to be present
if (isNotPresent(action, expected, Element.CANT_TYPE)) {
return true;
}
// wait for element to be enabled
return isNotEnabled(action, expected, Element.CANT_TY... | [
"private",
"boolean",
"isNotPresentEnabledInput",
"(",
"String",
"action",
",",
"String",
"expected",
")",
"{",
"// wait for element to be present",
"if",
"(",
"isNotPresent",
"(",
"action",
",",
"expected",
",",
"Element",
".",
"CANT_TYPE",
")",
")",
"{",
"return... | Determines if something is present, enabled, and an input. This returns
true if all three are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected result
@return Boolean: is the element present, enabled, and an input? | [
"Determines",
"if",
"something",
"is",
"present",
"enabled",
"and",
"an",
"input",
".",
"This",
"returns",
"true",
"if",
"all",
"three",
"are",
"true",
"otherwise",
"it",
"returns",
"false"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L715-L722 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresentDisplayedEnabledInput | private boolean isNotPresentDisplayedEnabledInput(String action, String expected, String extra) {
// wait for element to be present
if (isNotPresent(action, expected, extra)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, ext... | java | private boolean isNotPresentDisplayedEnabledInput(String action, String expected, String extra) {
// wait for element to be present
if (isNotPresent(action, expected, extra)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, ext... | [
"private",
"boolean",
"isNotPresentDisplayedEnabledInput",
"(",
"String",
"action",
",",
"String",
"expected",
",",
"String",
"extra",
")",
"{",
"// wait for element to be present",
"if",
"(",
"isNotPresent",
"(",
"action",
",",
"expected",
",",
"extra",
")",
")",
... | Determines if something is present, displayed, enabled, and an input.
This returns true if all four are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected result
@param extra - what actually is occurring
@return Boolean: is the element present, displa... | [
"Determines",
"if",
"something",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"This",
"returns",
"true",
"if",
"all",
"four",
"are",
"true",
"otherwise",
"it",
"returns",
"false"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L734-L745 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isNotPresentDisplayedEnabledSelect | private boolean isNotPresentDisplayedEnabledSelect(String action, String expected) {
// wait for element to be present
if (isNotPresent(action, expected, Element.CANT_SELECT)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, El... | java | private boolean isNotPresentDisplayedEnabledSelect(String action, String expected) {
// wait for element to be present
if (isNotPresent(action, expected, Element.CANT_SELECT)) {
return true;
}
// wait for element to be displayed
if (isNotDisplayed(action, expected, El... | [
"private",
"boolean",
"isNotPresentDisplayedEnabledSelect",
"(",
"String",
"action",
",",
"String",
"expected",
")",
"{",
"// wait for element to be present",
"if",
"(",
"isNotPresent",
"(",
"action",
",",
"expected",
",",
"Element",
".",
"CANT_SELECT",
")",
")",
"{... | Determines if something is present, displayed, enabled, and a select.
This returns true if all four are true, otherwise, it returns false
@param action - what action is occurring
@param expected - what is the expected result
@return Boolean: is the element present, displayed, enabled, and an
input? | [
"Determines",
"if",
"something",
"is",
"present",
"displayed",
"enabled",
"and",
"a",
"select",
".",
"This",
"returns",
"true",
"if",
"all",
"four",
"are",
"true",
"otherwise",
"it",
"returns",
"false"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L756-L767 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.click | public void click() {
String cantClick = "Unable to click ";
String action = "Clicking " + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to be clicked";
try {
if (isNotPresentDisplayedEnabled(action, expected, cantClick)) {
... | java | public void click() {
String cantClick = "Unable to click ";
String action = "Clicking " + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to be clicked";
try {
if (isNotPresentDisplayedEnabled(action, expected, cantClick)) {
... | [
"public",
"void",
"click",
"(",
")",
"{",
"String",
"cantClick",
"=",
"\"Unable to click \"",
";",
"String",
"action",
"=",
"\"Clicking \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is present, displa... | Clicks on the element, but only if the element is present, displayed and
enabled. If those conditions are not met, the click action will be
logged, but skipped and the test will continue. | [
"Clicks",
"on",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"displayed",
"and",
"enabled",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
"click",
"action",
"will",
"be",
"logged",
"but",
"skipped",
"and",
"the"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L778-L794 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.hover | public void hover() {
String cantHover = "Unable to hover over ";
String action = "Hovering over " + prettyOutput();
String expected = prettyOutputStart() + " is present, and displayed to be hovered over";
try {
// wait for element to be present
if (isNotPresent(a... | java | public void hover() {
String cantHover = "Unable to hover over ";
String action = "Hovering over " + prettyOutput();
String expected = prettyOutputStart() + " is present, and displayed to be hovered over";
try {
// wait for element to be present
if (isNotPresent(a... | [
"public",
"void",
"hover",
"(",
")",
"{",
"String",
"cantHover",
"=",
"\"Unable to hover over \"",
";",
"String",
"action",
"=",
"\"Hovering over \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is prese... | Hovers over the element, but only if the element is present and
displayed. If those conditions are not met, the hover action will be
logged, but skipped and the test will continue. | [
"Hovers",
"over",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"and",
"displayed",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
"hover",
"action",
"will",
"be",
"logged",
"but",
"skipped",
"and",
"the",
"test",... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L824-L846 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.focus | public void focus() {
String cantFocus = "Unable to focus on ";
String action = "Focusing on " + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to be focused";
try {
if (isNotPresentDisplayedEnabledInput(action, expected, cantFocu... | java | public void focus() {
String cantFocus = "Unable to focus on ";
String action = "Focusing on " + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to be focused";
try {
if (isNotPresentDisplayedEnabledInput(action, expected, cantFocu... | [
"public",
"void",
"focus",
"(",
")",
"{",
"String",
"cantFocus",
"=",
"\"Unable to focus on \"",
";",
"String",
"action",
"=",
"\"Focusing on \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is present, ... | Focuses on the element, but only if the element
is present, displayed, enabled, and an input. If those conditions are not
met, the focus action will be logged, but skipped and the test will
continue. | [
"Focuses",
"on",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
"focus",
"action",
"will",
"be",
"logged",
"but",
"skippe... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L854-L870 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.type | public void type(String text) {
String action = "Typing text '" + text + IN + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to have text " + text + " typed in";
boolean warning = false;
try {
if (isNotPresentEnabledInput(action, ... | java | public void type(String text) {
String action = "Typing text '" + text + IN + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to have text " + text + " typed in";
boolean warning = false;
try {
if (isNotPresentEnabledInput(action, ... | [
"public",
"void",
"type",
"(",
"String",
"text",
")",
"{",
"String",
"action",
"=",
"\"Typing text '\"",
"+",
"text",
"+",
"IN",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is present, displayed, and e... | Type the supplied text into the element, but only if the element is
present, enabled, and an input. If those conditions are not met, the type
action will be logged, but skipped and the test will continue. If the
element is not displayed, a warning will be written in the log, to
indicate this is not a normal action as c... | [
"Type",
"the",
"supplied",
"text",
"into",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"enabled",
"and",
"an",
"input",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
"type",
"action",
"will",
"be",
"logged",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L905-L929 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.clear | public void clear() {
String cantClear = "Unable to clear ";
String action = "Clearing text in " + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to have text cleared";
try {
if (isNotPresentDisplayedEnabledInput(action, expected,... | java | public void clear() {
String cantClear = "Unable to clear ";
String action = "Clearing text in " + prettyOutput();
String expected = prettyOutputStart() + " is present, displayed, and enabled to have text cleared";
try {
if (isNotPresentDisplayedEnabledInput(action, expected,... | [
"public",
"void",
"clear",
"(",
")",
"{",
"String",
"cantClear",
"=",
"\"Unable to clear \"",
";",
"String",
"action",
"=",
"\"Clearing text in \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is present... | Clears text from the element, but only if the element is present,
displayed, enabled, and an input. If those conditions are not met, the
clear action will be logged, but skipped and the test will continue. | [
"Clears",
"text",
"from",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
"clear",
"action",
"will",
"be",
"logged",
"but"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L971-L987 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.select | public void select(int index) {
String action = SELECTING + index + " in " + prettyOutput();
String expected = prettyOutputStart() + PRESENT_DISPLAYED_AND_ENABLED + index + SELECTED;
try {
if (isNotPresentDisplayedEnabledSelect(action, expected)) {
return;
... | java | public void select(int index) {
String action = SELECTING + index + " in " + prettyOutput();
String expected = prettyOutputStart() + PRESENT_DISPLAYED_AND_ENABLED + index + SELECTED;
try {
if (isNotPresentDisplayedEnabledSelect(action, expected)) {
return;
... | [
"public",
"void",
"select",
"(",
"int",
"index",
")",
"{",
"String",
"action",
"=",
"SELECTING",
"+",
"index",
"+",
"\" in \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"PRESENT_DISPLAYED_AND_ENABLED",
... | Selects the Nth option from the element, starting from 0, but only if the
element is present, displayed, enabled, and an input. If those conditions
are not met, the select action will be logged, but skipped and the test
will continue.
@param index - the select option to be selected - note, row numbering
starts at 0 | [
"Selects",
"the",
"Nth",
"option",
"from",
"the",
"element",
"starting",
"from",
"0",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
"selec... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L998-L1022 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.selectOption | public void selectOption(String option) {
String action = SELECTING + option + " in " + prettyOutput();
String expected = prettyOutputStart() + PRESENT_DISPLAYED_AND_ENABLED + option + SELECTED;
try {
if (isNotPresentDisplayedEnabledSelect(action, expected)) {
return;... | java | public void selectOption(String option) {
String action = SELECTING + option + " in " + prettyOutput();
String expected = prettyOutputStart() + PRESENT_DISPLAYED_AND_ENABLED + option + SELECTED;
try {
if (isNotPresentDisplayedEnabledSelect(action, expected)) {
return;... | [
"public",
"void",
"selectOption",
"(",
"String",
"option",
")",
"{",
"String",
"action",
"=",
"SELECTING",
"+",
"option",
"+",
"\" in \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"PRESENT_DISPLAYED_AND... | Selects the option from the dropdown matching the provided value, but
only if the element is present, displayed, enabled, and an input. If
those conditions are not met, the select action will be logged, but
skipped and the test will continue.
@param option - the select option to be selected | [
"Selects",
"the",
"option",
"from",
"the",
"dropdown",
"matching",
"the",
"provided",
"value",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1032-L1056 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.selectValue | public void selectValue(String value) {
String action = SELECTING + value + " in " + prettyOutput();
String expected = prettyOutputStart() + PRESENT_DISPLAYED_AND_ENABLED + value + SELECTED;
try {
if (isNotPresentDisplayedEnabledSelect(action, expected)) {
return;
... | java | public void selectValue(String value) {
String action = SELECTING + value + " in " + prettyOutput();
String expected = prettyOutputStart() + PRESENT_DISPLAYED_AND_ENABLED + value + SELECTED;
try {
if (isNotPresentDisplayedEnabledSelect(action, expected)) {
return;
... | [
"public",
"void",
"selectValue",
"(",
"String",
"value",
")",
"{",
"String",
"action",
"=",
"SELECTING",
"+",
"value",
"+",
"\" in \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"PRESENT_DISPLAYED_AND_EN... | Selects the value from the dropdown matching the provided value, but only
if the element is present, displayed, enabled, and an input. If those
conditions are not met, the select action will be logged, but skipped and
the test will continue.
@param value - the select value to be selected | [
"Selects",
"the",
"value",
"from",
"the",
"dropdown",
"matching",
"the",
"provided",
"value",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"displayed",
"enabled",
"and",
"an",
"input",
".",
"If",
"those",
"conditions",
"are",
"not",
"met",
"the",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1066-L1090 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.isScrolledTo | private void isScrolledTo(String action, String expected) {
WebElement webElement = getWebElement();
long elementPosition = webElement.getLocation().getY();
JavascriptExecutor js = (JavascriptExecutor) driver;
int scrollHeight = ((Number) js.executeScript("return document.documentElement... | java | private void isScrolledTo(String action, String expected) {
WebElement webElement = getWebElement();
long elementPosition = webElement.getLocation().getY();
JavascriptExecutor js = (JavascriptExecutor) driver;
int scrollHeight = ((Number) js.executeScript("return document.documentElement... | [
"private",
"void",
"isScrolledTo",
"(",
"String",
"action",
",",
"String",
"expected",
")",
"{",
"WebElement",
"webElement",
"=",
"getWebElement",
"(",
")",
";",
"long",
"elementPosition",
"=",
"webElement",
".",
"getLocation",
"(",
")",
".",
"getY",
"(",
")... | Determines if the element scrolled towards is now currently displayed on the
screen
@param action - what is the action occurring
@param expected - what is the expected outcome of said action | [
"Determines",
"if",
"the",
"element",
"scrolled",
"towards",
"is",
"now",
"currently",
"displayed",
"on",
"the",
"screen"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1112-L1124 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.scrollTo | public void scrollTo() {
String action = "Scrolling screen to " + prettyOutput();
String expected = prettyOutputStart() + " is now within the current viewport";
try {
// wait for element to be present
if (isNotPresent(action, expected, CANT_SCROLL)) {
retu... | java | public void scrollTo() {
String action = "Scrolling screen to " + prettyOutput();
String expected = prettyOutputStart() + " is now within the current viewport";
try {
// wait for element to be present
if (isNotPresent(action, expected, CANT_SCROLL)) {
retu... | [
"public",
"void",
"scrollTo",
"(",
")",
"{",
"String",
"action",
"=",
"\"Scrolling screen to \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
"\" is now within the current viewport\"",
";",
"try",
"{",
"// wai... | Scrolls the page to the element, making it displayed on the current
viewport, but only if the element is present. If that condition is not
met, the scroll action will be logged, but skipped and the test will
continue. | [
"Scrolls",
"the",
"page",
"to",
"the",
"element",
"making",
"it",
"displayed",
"on",
"the",
"current",
"viewport",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
".",
"If",
"that",
"condition",
"is",
"not",
"met",
"the",
"scroll",
"action",
"will"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1132-L1149 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.scrollTo | public void scrollTo(long position) {
String action = "Scrolling screen to " + position + " pixels above " + prettyOutput();
String expected = prettyOutputStart() + " is now within the current viewport";
try {
// wait for element to be present
if (isNotPresent(action, exp... | java | public void scrollTo(long position) {
String action = "Scrolling screen to " + position + " pixels above " + prettyOutput();
String expected = prettyOutputStart() + " is now within the current viewport";
try {
// wait for element to be present
if (isNotPresent(action, exp... | [
"public",
"void",
"scrollTo",
"(",
"long",
"position",
")",
"{",
"String",
"action",
"=",
"\"Scrolling screen to \"",
"+",
"position",
"+",
"\" pixels above \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"prettyOutputStart",
"(",
")",
"+",
... | Scrolls the page to the element, leaving X pixels at the top of the
viewport above it, making it displayed on the current viewport, but only
if the element is present. If that condition is not met, the scroll action
will be logged, but skipped and the test will continue.
@param position - how many pixels above the ele... | [
"Scrolls",
"the",
"page",
"to",
"the",
"element",
"leaving",
"X",
"pixels",
"at",
"the",
"top",
"of",
"the",
"viewport",
"above",
"it",
"making",
"it",
"displayed",
"on",
"the",
"current",
"viewport",
"but",
"only",
"if",
"the",
"element",
"is",
"present",... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1159-L1178 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.draw | public void draw(List<Point<Integer, Integer>> points) {
if (points.isEmpty()) {
reporter.fail("Drawing object in " + prettyOutput(), "Drew object in " + prettyOutput(),
"Unable to draw in " + prettyOutput() + " as no points were supplied");
return;
}
... | java | public void draw(List<Point<Integer, Integer>> points) {
if (points.isEmpty()) {
reporter.fail("Drawing object in " + prettyOutput(), "Drew object in " + prettyOutput(),
"Unable to draw in " + prettyOutput() + " as no points were supplied");
return;
}
... | [
"public",
"void",
"draw",
"(",
"List",
"<",
"Point",
"<",
"Integer",
",",
"Integer",
">",
">",
"points",
")",
"{",
"if",
"(",
"points",
".",
"isEmpty",
"(",
")",
")",
"{",
"reporter",
".",
"fail",
"(",
"\"Drawing object in \"",
"+",
"prettyOutput",
"("... | Simulates moving the mouse around while the cursor is pressed. Can be
used for drawing on canvases, or swiping on certain elements. Note, this is not supported in HTMLUNIT
@param points - a list of points to connect. At least one point must be
provided in the list | [
"Simulates",
"moving",
"the",
"mouse",
"around",
"while",
"the",
"cursor",
"is",
"pressed",
".",
"Can",
"be",
"used",
"for",
"drawing",
"on",
"canvases",
"or",
"swiping",
"on",
"certain",
"elements",
".",
"Note",
"this",
"is",
"not",
"supported",
"in",
"HT... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1187-L1224 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.selectFrame | public void selectFrame() {
String cantSelect = "Unable to focus on frame ";
String action = "Focusing on frame " + prettyOutput();
String expected = "Frame " + prettyOutput() + " is present, displayed, and focused";
try {
// wait for element to be present
if (isN... | java | public void selectFrame() {
String cantSelect = "Unable to focus on frame ";
String action = "Focusing on frame " + prettyOutput();
String expected = "Frame " + prettyOutput() + " is present, displayed, and focused";
try {
// wait for element to be present
if (isN... | [
"public",
"void",
"selectFrame",
"(",
")",
"{",
"String",
"cantSelect",
"=",
"\"Unable to focus on frame \"",
";",
"String",
"action",
"=",
"\"Focusing on frame \"",
"+",
"prettyOutput",
"(",
")",
";",
"String",
"expected",
"=",
"\"Frame \"",
"+",
"prettyOutput",
... | Selects the frame represented by the element, but only if the element is
present and displayed. If these conditions are not met, the move action
will be logged, but skipped and the test will continue. | [
"Selects",
"the",
"frame",
"represented",
"by",
"the",
"element",
"but",
"only",
"if",
"the",
"element",
"is",
"present",
"and",
"displayed",
".",
"If",
"these",
"conditions",
"are",
"not",
"met",
"the",
"move",
"action",
"will",
"be",
"logged",
"but",
"sk... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1231-L1253 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Element.java | Element.getScreenshot | private String getScreenshot() {
WebElement webElement = getWebElement();
String imageLink = "<b><font class='fail'>No Image Preview</font></b>";
// capture an image of it
try {
imageLink = reporter.captureEntirePageScreenshot();
File image = new File(reporter.get... | java | private String getScreenshot() {
WebElement webElement = getWebElement();
String imageLink = "<b><font class='fail'>No Image Preview</font></b>";
// capture an image of it
try {
imageLink = reporter.captureEntirePageScreenshot();
File image = new File(reporter.get... | [
"private",
"String",
"getScreenshot",
"(",
")",
"{",
"WebElement",
"webElement",
"=",
"getWebElement",
"(",
")",
";",
"String",
"imageLink",
"=",
"\"<b><font class='fail'>No Image Preview</font></b>\"",
";",
"// capture an image of it",
"try",
"{",
"imageLink",
"=",
"re... | Captures an image of the element, and returns the html friendly link of
it for use in the logging file. If there is a problem capturing the
image, an error message is returned instead.
@return String the location of the screenshot | [
"Captures",
"an",
"image",
"of",
"the",
"element",
"and",
"returns",
"the",
"html",
"friendly",
"link",
"of",
"it",
"for",
"use",
"in",
"the",
"logging",
"file",
".",
"If",
"there",
"is",
"a",
"problem",
"capturing",
"the",
"image",
"an",
"error",
"messa... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Element.java#L1262-L1282 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.selectedOption | public String selectedOption() {
if (isNotPresentSelect()) {
return null;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
WebElement option = dropdown.getFirstSelectedOption();
return option.getText();
} | java | public String selectedOption() {
if (isNotPresentSelect()) {
return null;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
WebElement option = dropdown.getFirstSelectedOption();
return option.getText();
} | [
"public",
"String",
"selectedOption",
"(",
")",
"{",
"if",
"(",
"isNotPresentSelect",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"WebElement",
"webElement",
"=",
"element",
".",
"getWebElement",
"(",
")",
";",
"Select",
"dropdown",
"=",
"new",
"Select... | Retrieves the selected option for the element. If the element isn't
present or a select, a null value will be returned.
@return String: the option from the select element | [
"Retrieves",
"the",
"selected",
"option",
"for",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L89-L97 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.selectedValue | public String selectedValue() {
if (isNotPresentSelect()) {
return null;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
WebElement option = dropdown.getFirstSelectedOption();
return option.getAttribute(VALUE);
... | java | public String selectedValue() {
if (isNotPresentSelect()) {
return null;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
WebElement option = dropdown.getFirstSelectedOption();
return option.getAttribute(VALUE);
... | [
"public",
"String",
"selectedValue",
"(",
")",
"{",
"if",
"(",
"isNotPresentSelect",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"WebElement",
"webElement",
"=",
"element",
".",
"getWebElement",
"(",
")",
";",
"Select",
"dropdown",
"=",
"new",
"Select"... | Retrieves the selected value for the element. If the element isn't
present or a select, a null value will be returned.
@return String: the options from the select element | [
"Retrieves",
"the",
"selected",
"value",
"for",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L126-L134 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.selectedValues | @SuppressWarnings("squid:S1168")
public String[] selectedValues() {
if (isNotPresentSelect()) {
return null; // returning an empty array could be confused with no values selected
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement... | java | @SuppressWarnings("squid:S1168")
public String[] selectedValues() {
if (isNotPresentSelect()) {
return null; // returning an empty array could be confused with no values selected
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement... | [
"@",
"SuppressWarnings",
"(",
"\"squid:S1168\"",
")",
"public",
"String",
"[",
"]",
"selectedValues",
"(",
")",
"{",
"if",
"(",
"isNotPresentSelect",
"(",
")",
")",
"{",
"return",
"null",
";",
"// returning an empty array could be confused with no values selected",
"}... | Retrieves the selected values for the element. If the element isn't
present or a select, a null value will be returned.
@return String[]: the options from the select element | [
"Retrieves",
"the",
"selected",
"values",
"for",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L142-L155 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.text | public String text() {
if (!element.is().present()) {
return null;
}
WebElement webElement = element.getWebElement();
return webElement.getText();
} | java | public String text() {
if (!element.is().present()) {
return null;
}
WebElement webElement = element.getWebElement();
return webElement.getText();
} | [
"public",
"String",
"text",
"(",
")",
"{",
"if",
"(",
"!",
"element",
".",
"is",
"(",
")",
".",
"present",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"WebElement",
"webElement",
"=",
"element",
".",
"getWebElement",
"(",
")",
";",
"return",
"w... | Retrieves the text of the element. If the element isn't present, a null
value will be returned.
@return String: the text of the element | [
"Retrieves",
"the",
"text",
"of",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L163-L169 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.value | public String value() {
if (!element.is().present() || !element.is().input()) {
return null;
}
WebElement webElement = element.getWebElement();
return webElement.getAttribute(VALUE);
} | java | public String value() {
if (!element.is().present() || !element.is().input()) {
return null;
}
WebElement webElement = element.getWebElement();
return webElement.getAttribute(VALUE);
} | [
"public",
"String",
"value",
"(",
")",
"{",
"if",
"(",
"!",
"element",
".",
"is",
"(",
")",
".",
"present",
"(",
")",
"||",
"!",
"element",
".",
"is",
"(",
")",
".",
"input",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"WebElement",
"webEle... | Retrieves the value of the element. If the element isn't present, or
isn't an input, a null value will be returned.
@return String: the text of the element | [
"Retrieves",
"the",
"value",
"of",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"isn",
"t",
"an",
"input",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L177-L183 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.css | public String css(String attribute) {
if (!element.is().present()) {
return null;
}
try {
WebElement webElement = element.getWebElement();
return webElement.getCssValue(attribute);
} catch (NoSuchMethodError | Exception e) {
log.warn(e);
... | java | public String css(String attribute) {
if (!element.is().present()) {
return null;
}
try {
WebElement webElement = element.getWebElement();
return webElement.getCssValue(attribute);
} catch (NoSuchMethodError | Exception e) {
log.warn(e);
... | [
"public",
"String",
"css",
"(",
"String",
"attribute",
")",
"{",
"if",
"(",
"!",
"element",
".",
"is",
"(",
")",
".",
"present",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"WebElement",
"webElement",
"=",
"element",
".",
"getWebEleme... | Retrieves the provided css attribute of the element. If the element isn't
present, the css attribute doesn't exist, or the attributes can't be
accessed, a null value will be returned.
@param attribute - the css attribute to be returned
@return String: the value of the css attribute | [
"Retrieves",
"the",
"provided",
"css",
"attribute",
"of",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"the",
"css",
"attribute",
"doesn",
"t",
"exist",
"or",
"the",
"attributes",
"can",
"t",
"be",
"accessed",
"a",
"null",
"value",... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L193-L204 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.allAttributes | @SuppressWarnings("unchecked")
public Map<String, String> allAttributes() {
if (!element.is().present()) {
return null;
}
try {
WebElement webElement = element.getWebElement();
JavascriptExecutor js = (JavascriptExecutor) driver;
return (Map<St... | java | @SuppressWarnings("unchecked")
public Map<String, String> allAttributes() {
if (!element.is().present()) {
return null;
}
try {
WebElement webElement = element.getWebElement();
JavascriptExecutor js = (JavascriptExecutor) driver;
return (Map<St... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"allAttributes",
"(",
")",
"{",
"if",
"(",
"!",
"element",
".",
"is",
"(",
")",
".",
"present",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
... | Retrieves all attributes of the element. If the element isn't present, or
the attributes can't be accessed, a null value will be returned.
@return String: the value of the css attribute | [
"Retrieves",
"all",
"attributes",
"of",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"the",
"attributes",
"can",
"t",
"be",
"accessed",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L233-L248 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.eval | public Object eval(String javascriptFunction) {
if (!element.is().present()) {
return null;
}
try {
WebElement webElement = element.getWebElement();
JavascriptExecutor js = (JavascriptExecutor) driver;
return js.executeScript(javascriptFunction, we... | java | public Object eval(String javascriptFunction) {
if (!element.is().present()) {
return null;
}
try {
WebElement webElement = element.getWebElement();
JavascriptExecutor js = (JavascriptExecutor) driver;
return js.executeScript(javascriptFunction, we... | [
"public",
"Object",
"eval",
"(",
"String",
"javascriptFunction",
")",
"{",
"if",
"(",
"!",
"element",
".",
"is",
"(",
")",
".",
"present",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"WebElement",
"webElement",
"=",
"element",
".",
"g... | Executes a provided script on the element, and returns the output of that
script. If the element doesn't exist, or there is an error executing this
script, a null value will be returned.
@param javascriptFunction - the javascript function that is going to be executed
@return Object: any resultant output from the javas... | [
"Executes",
"a",
"provided",
"script",
"on",
"the",
"element",
"and",
"returns",
"the",
"output",
"of",
"that",
"script",
".",
"If",
"the",
"element",
"doesn",
"t",
"exist",
"or",
"there",
"is",
"an",
"error",
"executing",
"this",
"script",
"a",
"null",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L258-L270 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.numOfSelectOptions | public int numOfSelectOptions() {
if (isNotPresentSelect()) {
return -1;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
List<WebElement> options = dropdown.getOptions();
return options.size();
} | java | public int numOfSelectOptions() {
if (isNotPresentSelect()) {
return -1;
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElement);
List<WebElement> options = dropdown.getOptions();
return options.size();
} | [
"public",
"int",
"numOfSelectOptions",
"(",
")",
"{",
"if",
"(",
"isNotPresentSelect",
"(",
")",
")",
"{",
"return",
"-",
"1",
";",
"}",
"WebElement",
"webElement",
"=",
"element",
".",
"getWebElement",
"(",
")",
";",
"Select",
"dropdown",
"=",
"new",
"S... | Retrieves the number of select options in the element. If the element
isn't present or a select, the returned response will be negative 1.
@return Integer: how many select options are available in the select
element | [
"Retrieves",
"the",
"number",
"of",
"select",
"options",
"in",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"the",
"returned",
"response",
"will",
"be",
"negative",
"1",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L279-L287 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.selectOptions | @SuppressWarnings("squid:S1168")
public String[] selectOptions() {
if (isNotPresentSelect()) {
return null; // returning an empty array could be confused with no options available
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElemen... | java | @SuppressWarnings("squid:S1168")
public String[] selectOptions() {
if (isNotPresentSelect()) {
return null; // returning an empty array could be confused with no options available
}
WebElement webElement = element.getWebElement();
Select dropdown = new Select(webElemen... | [
"@",
"SuppressWarnings",
"(",
"\"squid:S1168\"",
")",
"public",
"String",
"[",
"]",
"selectOptions",
"(",
")",
"{",
"if",
"(",
"isNotPresentSelect",
"(",
")",
")",
"{",
"return",
"null",
";",
"// returning an empty array could be confused with no options available",
"... | Retrieves the select options in the element. If the element isn't present
or a select, a null value will be returned.
@return String[]: the options from the select element | [
"Retrieves",
"the",
"select",
"options",
"in",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"select",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L295-L308 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.tableRows | @SuppressWarnings("squid:S1168")
public Element tableRows() {
if (!element.is().present()) {
return null; // returning an empty array could be confused with no rows
}
if (!element.is().table()) {
return null; // returning an empty array could be confused with no... | java | @SuppressWarnings("squid:S1168")
public Element tableRows() {
if (!element.is().present()) {
return null; // returning an empty array could be confused with no rows
}
if (!element.is().table()) {
return null; // returning an empty array could be confused with no... | [
"@",
"SuppressWarnings",
"(",
"\"squid:S1168\"",
")",
"public",
"Element",
"tableRows",
"(",
")",
"{",
"if",
"(",
"!",
"element",
".",
"is",
"(",
")",
".",
"present",
"(",
")",
")",
"{",
"return",
"null",
";",
"// returning an empty array could be confused wit... | Retrieves the rows in the element. If the element isn't present or a
table, a null value will be returned. The rows will be returned in one element
and they can be iterated through, or selecting using the `setMatch` method
@return List: a list of the table rows as WebElements | [
"Retrieves",
"the",
"rows",
"in",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"table",
"a",
"null",
"value",
"will",
"be",
"returned",
".",
"The",
"rows",
"will",
"be",
"returned",
"in",
"one",
"element",
"and",
"th... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L352-L361 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.numOfTableColumns | public int numOfTableColumns() {
Element rows = tableRows();
if (rows == null) {
return -1;
}
Element thCells = rows.findChild(app.newElement(Locator.TAGNAME, "th"));
Element tdCells = rows.findChild(app.newElement(Locator.TAGNAME, "td"));
return thCells.get()... | java | public int numOfTableColumns() {
Element rows = tableRows();
if (rows == null) {
return -1;
}
Element thCells = rows.findChild(app.newElement(Locator.TAGNAME, "th"));
Element tdCells = rows.findChild(app.newElement(Locator.TAGNAME, "td"));
return thCells.get()... | [
"public",
"int",
"numOfTableColumns",
"(",
")",
"{",
"Element",
"rows",
"=",
"tableRows",
"(",
")",
";",
"if",
"(",
"rows",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"Element",
"thCells",
"=",
"rows",
".",
"findChild",
"(",
"app",
".",
... | Retrieves the number of columns in the element. If the element isn't
present or a table, the returned response will be negative one
@return Integer: the number of columns the table has | [
"Retrieves",
"the",
"number",
"of",
"columns",
"in",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"table",
"the",
"returned",
"response",
"will",
"be",
"negative",
"one"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L369-L377 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.tableRow | @SuppressWarnings("squid:S1168")
public Element tableRow(int rowNum) {
Element rows = tableRows();
if (rows == null) {
return null;
}
if (numOfTableRows() < rowNum) {
return null;
}
return rows.get(rowNum);
} | java | @SuppressWarnings("squid:S1168")
public Element tableRow(int rowNum) {
Element rows = tableRows();
if (rows == null) {
return null;
}
if (numOfTableRows() < rowNum) {
return null;
}
return rows.get(rowNum);
} | [
"@",
"SuppressWarnings",
"(",
"\"squid:S1168\"",
")",
"public",
"Element",
"tableRow",
"(",
"int",
"rowNum",
")",
"{",
"Element",
"rows",
"=",
"tableRows",
"(",
")",
";",
"if",
"(",
"rows",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",... | Retrieves a specific row from the element. If the element isn't present
or a table, or doesn't have that many rows a null value will be returned.
@param rowNum - the row number of the table to obtain - note, row numbering
starts at 0
@return List: a list of the table cells in the row as WebElements | [
"Retrieves",
"a",
"specific",
"row",
"from",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"table",
"or",
"doesn",
"t",
"have",
"that",
"many",
"rows",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L387-L397 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/element/Get.java | Get.tableCell | public Element tableCell(int rowNum, int colNum) {
Element row = tableRow(rowNum);
if (row == null || numOfTableColumns() < colNum) {
return null;
}
Element thCells = row.findChild(app.newElement(Locator.TAGNAME, "th"));
Element tdCells = row.findChild(app.newElement(... | java | public Element tableCell(int rowNum, int colNum) {
Element row = tableRow(rowNum);
if (row == null || numOfTableColumns() < colNum) {
return null;
}
Element thCells = row.findChild(app.newElement(Locator.TAGNAME, "th"));
Element tdCells = row.findChild(app.newElement(... | [
"public",
"Element",
"tableCell",
"(",
"int",
"rowNum",
",",
"int",
"colNum",
")",
"{",
"Element",
"row",
"=",
"tableRow",
"(",
"rowNum",
")",
";",
"if",
"(",
"row",
"==",
"null",
"||",
"numOfTableColumns",
"(",
")",
"<",
"colNum",
")",
"{",
"return",
... | Retrieves a specific cell from the element. If the element isn't present
or a table, or the row and cell combination doesn't exist, a null value
will be returned.
@param rowNum - the number of the row in the table - note, row numbering
starts at 0
@param colNum - the number of the column in the table - note, column
nu... | [
"Retrieves",
"a",
"specific",
"cell",
"from",
"the",
"element",
".",
"If",
"the",
"element",
"isn",
"t",
"present",
"or",
"a",
"table",
"or",
"the",
"row",
"and",
"cell",
"combination",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/element/Get.java#L411-L423 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.getHeaders | public Map<String, Object> getHeaders() {
Map<String, Object> map = new HashMap<>();
map.put("Content-length", "0");
map.put(CONTENT_TYPE, contentType);
map.put("Accept", "application/json");
for (Map.Entry<String, Object> entry : extraHeaders.entrySet()) {
map.put(en... | java | public Map<String, Object> getHeaders() {
Map<String, Object> map = new HashMap<>();
map.put("Content-length", "0");
map.put(CONTENT_TYPE, contentType);
map.put("Accept", "application/json");
for (Map.Entry<String, Object> entry : extraHeaders.entrySet()) {
map.put(en... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getHeaders",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"Content-length\"",
",",
"\"0\"",
")",
";",
"map... | Builds the headers to be passed in the HTTP call
@return Map: a mapping of the headers in key to values | [
"Builds",
"the",
"headers",
"to",
"be",
"passed",
"in",
"the",
"HTTP",
"call"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L116-L125 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.get | public Response get(String service, Request request) throws IOException {
return call(Method.GET, service, request, null);
} | java | public Response get(String service, Request request) throws IOException {
return call(Method.GET, service, request, null);
} | [
"public",
"Response",
"get",
"(",
"String",
"service",
",",
"Request",
"request",
")",
"throws",
"IOException",
"{",
"return",
"call",
"(",
"Method",
".",
"GET",
",",
"service",
",",
"request",
",",
"null",
")",
";",
"}"
] | A basic http get call
@param service - the endpoint of the service under test
@param request - the parameters to be passed to the endpoint for the service
call
@return Response: the response provided from the http call | [
"A",
"basic",
"http",
"get",
"call"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L195-L197 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.post | public Response post(String service, Request request, File file) throws IOException {
if (file != null) {
this.contentType = MULTIPART + BOUNDARY;
}
return call(Method.POST, service, request, file);
} | java | public Response post(String service, Request request, File file) throws IOException {
if (file != null) {
this.contentType = MULTIPART + BOUNDARY;
}
return call(Method.POST, service, request, file);
} | [
"public",
"Response",
"post",
"(",
"String",
"service",
",",
"Request",
"request",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"this",
".",
"contentType",
"=",
"MULTIPART",
"+",
"BOUNDARY",
";",
"}",... | A basic http post call
@param service - the endpoint of the service under test
@param request - the parameters to be passed to the endpoint for the service
call
@param file - a file to upload, accompanied with the post
@return Response: the response provided from the http call | [
"A",
"basic",
"http",
"post",
"call"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L208-L213 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.put | public Response put(String service, Request request, File file) throws IOException {
if (file != null) {
this.contentType = MULTIPART + BOUNDARY;
}
return call(Method.PUT, service, request, file);
} | java | public Response put(String service, Request request, File file) throws IOException {
if (file != null) {
this.contentType = MULTIPART + BOUNDARY;
}
return call(Method.PUT, service, request, file);
} | [
"public",
"Response",
"put",
"(",
"String",
"service",
",",
"Request",
"request",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"this",
".",
"contentType",
"=",
"MULTIPART",
"+",
"BOUNDARY",
";",
"}",
... | A basic http put call
@param service - the endpoint of the service under test
@param request - the parameters to be passed to the endpoint for the service
call
@param file - a file to upload, accompanied with the post
@return Response: the response provided from the http call | [
"A",
"basic",
"http",
"put",
"call"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L224-L229 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.delete | public Response delete(String service, Request request, File file) throws IOException {
if (file != null) {
this.contentType = MULTIPART + BOUNDARY;
}
return call(Method.DELETE, service, request, file);
} | java | public Response delete(String service, Request request, File file) throws IOException {
if (file != null) {
this.contentType = MULTIPART + BOUNDARY;
}
return call(Method.DELETE, service, request, file);
} | [
"public",
"Response",
"delete",
"(",
"String",
"service",
",",
"Request",
"request",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"!=",
"null",
")",
"{",
"this",
".",
"contentType",
"=",
"MULTIPART",
"+",
"BOUNDARY",
";",
"}... | A basic http delete call
@param service - the endpoint of the service under test
@param request - the parameters to be passed to the endpoint for the service
call
@param file - a file to upload, accompanied with the post
@return Response: the response provided from the http call | [
"A",
"basic",
"http",
"delete",
"call"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L240-L245 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.getRequestParams | public String getRequestParams(Request request) {
StringBuilder params = new StringBuilder();
if (request != null && request.getUrlParams() != null) {
params.append("?");
for (String key : request.getUrlParams().keySet()) {
params.append(key);
para... | java | public String getRequestParams(Request request) {
StringBuilder params = new StringBuilder();
if (request != null && request.getUrlParams() != null) {
params.append("?");
for (String key : request.getUrlParams().keySet()) {
params.append(key);
para... | [
"public",
"String",
"getRequestParams",
"(",
"Request",
"request",
")",
"{",
"StringBuilder",
"params",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"request",
"!=",
"null",
"&&",
"request",
".",
"getUrlParams",
"(",
")",
"!=",
"null",
")",
"{",
... | Returns a string representation of the parameters, able to be appended to the url
@param request - the parameters to be passed to the endpoint for the service
call
@return String: the string friendly url parameter representation | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"parameters",
"able",
"to",
"be",
"appended",
"to",
"the",
"url"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L254-L267 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.setupHeaders | private void setupHeaders(HttpURLConnection connection) {
for (Map.Entry<String, Object> entry : getHeaders().entrySet()) {
connection.setRequestProperty(entry.getKey(), String.valueOf(entry.getValue()));
}
connection.setDoOutput(true);
connection.setDoInput(true);
co... | java | private void setupHeaders(HttpURLConnection connection) {
for (Map.Entry<String, Object> entry : getHeaders().entrySet()) {
connection.setRequestProperty(entry.getKey(), String.valueOf(entry.getValue()));
}
connection.setDoOutput(true);
connection.setDoInput(true);
co... | [
"private",
"void",
"setupHeaders",
"(",
"HttpURLConnection",
"connection",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"getHeaders",
"(",
")",
".",
"entrySet",
"(",
")",
")",
"{",
"connection",
".",
"setReq... | Setups up the header and basic connection information
@param connection - the connection to add headers to | [
"Setups",
"up",
"the",
"header",
"and",
"basic",
"connection",
"information"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L274-L282 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.call | private Response call(Method method, String service, Request request, File file) throws IOException {
URL url = new URL(this.serviceBaseUrl + service + getRequestParams(request));
HttpURLConnection connection = getConnection(url);
connection.setRequestMethod(method.toString());
setupHead... | java | private Response call(Method method, String service, Request request, File file) throws IOException {
URL url = new URL(this.serviceBaseUrl + service + getRequestParams(request));
HttpURLConnection connection = getConnection(url);
connection.setRequestMethod(method.toString());
setupHead... | [
"private",
"Response",
"call",
"(",
"Method",
"method",
",",
"String",
"service",
",",
"Request",
"request",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"this",
".",
"serviceBaseUrl",
"+",
"service",
"+",
... | A basic generic http call
@param method - what method are we calling
@param service - the endpoint of the service under test
@param request - the parameters to be passed to the endpoint for the service
call
@param file - is there a file to upload as well
@return Response: the response provided from the http call | [
"A",
"basic",
"generic",
"http",
"call"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L294-L318 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.getConnection | private HttpURLConnection getConnection(URL url) throws IOException {
Proxy proxy = Proxy.NO_PROXY;
if (Property.isProxySet()) {
SocketAddress addr = new InetSocketAddress(Property.getProxyHost(), Property.getProxyPort());
proxy = new Proxy(Proxy.Type.HTTP, addr);
}
... | java | private HttpURLConnection getConnection(URL url) throws IOException {
Proxy proxy = Proxy.NO_PROXY;
if (Property.isProxySet()) {
SocketAddress addr = new InetSocketAddress(Property.getProxyHost(), Property.getProxyPort());
proxy = new Proxy(Proxy.Type.HTTP, addr);
}
... | [
"private",
"HttpURLConnection",
"getConnection",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Proxy",
"proxy",
"=",
"Proxy",
".",
"NO_PROXY",
";",
"if",
"(",
"Property",
".",
"isProxySet",
"(",
")",
")",
"{",
"SocketAddress",
"addr",
"=",
"new",
... | Opens the URL connection, and if a proxy is provided, uses the proxy to establish the connection
@param url - the url to connect to
@return HttpURLConnection: our established http connection
@throws IOException: if the connection can't be established, an IOException is thrown | [
"Opens",
"the",
"URL",
"connection",
"and",
"if",
"a",
"proxy",
"is",
"provided",
"uses",
"the",
"proxy",
"to",
"establish",
"the",
"connection"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L327-L334 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/services/HTTP.java | HTTP.getResponse | @SuppressWarnings({"squid:S3776", "squid:S2093"})
private Response getResponse(HttpURLConnection connection) {
int status;
Map headers;
try {
status = connection.getResponseCode();
headers = connection.getHeaderFields();
} catch (IOException e) {
l... | java | @SuppressWarnings({"squid:S3776", "squid:S2093"})
private Response getResponse(HttpURLConnection connection) {
int status;
Map headers;
try {
status = connection.getResponseCode();
headers = connection.getHeaderFields();
} catch (IOException e) {
l... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"squid:S3776\"",
",",
"\"squid:S2093\"",
"}",
")",
"private",
"Response",
"getResponse",
"(",
"HttpURLConnection",
"connection",
")",
"{",
"int",
"status",
";",
"Map",
"headers",
";",
"try",
"{",
"status",
"=",
"connection",
... | Extracts the response data from the open http connection
@param connection - the open connection of the http call
@return Response: the response provided from the http call | [
"Extracts",
"the",
"response",
"data",
"from",
"the",
"open",
"http",
"connection"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/services/HTTP.java#L403-L459 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Transformer.java | Transformer.transform | @SuppressWarnings("rawtypes")
@Override
public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {
annotation.setInvocationCount(StringUtils.countMatches(getBrowser(), ",") + 1);
} | java | @SuppressWarnings("rawtypes")
@Override
public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) {
annotation.setInvocationCount(StringUtils.countMatches(getBrowser(), ",") + 1);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"@",
"Override",
"public",
"void",
"transform",
"(",
"ITestAnnotation",
"annotation",
",",
"Class",
"testClass",
",",
"Constructor",
"testConstructor",
",",
"Method",
"testMethod",
")",
"{",
"annotation",
".",
"se... | overrides the basic TestNG transform function to provide dynamic access
to an invocation count | [
"overrides",
"the",
"basic",
"TestNG",
"transform",
"function",
"to",
"provide",
"dynamic",
"access",
"to",
"an",
"invocation",
"count"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Transformer.java#L49-L53 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.isRealBrowser | private boolean isRealBrowser() {
Browser browser = capabilities.getBrowser();
return browser.getName() != BrowserName.NONE && browser.getName() != BrowserName.HTMLUNIT;
} | java | private boolean isRealBrowser() {
Browser browser = capabilities.getBrowser();
return browser.getName() != BrowserName.NONE && browser.getName() != BrowserName.HTMLUNIT;
} | [
"private",
"boolean",
"isRealBrowser",
"(",
")",
"{",
"Browser",
"browser",
"=",
"capabilities",
".",
"getBrowser",
"(",
")",
";",
"return",
"browser",
".",
"getName",
"(",
")",
"!=",
"BrowserName",
".",
"NONE",
"&&",
"browser",
".",
"getName",
"(",
")",
... | Determines if a 'real' browser is being used. If the browser is NONE or
HTMLUNIT it is not considered a real browser
@return Boolean: is the browser a 'real' browser | [
"Determines",
"if",
"a",
"real",
"browser",
"is",
"being",
"used",
".",
"If",
"the",
"browser",
"is",
"NONE",
"or",
"HTMLUNIT",
"it",
"is",
"not",
"considered",
"a",
"real",
"browser"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L184-L187 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.generateFilename | private String generateFilename() {
String counter = "";
if (capabilities.getInstance() > 0) {
counter = "_" + capabilities.getInstance();
}
return test + counter;
} | java | private String generateFilename() {
String counter = "";
if (capabilities.getInstance() > 0) {
counter = "_" + capabilities.getInstance();
}
return test + counter;
} | [
"private",
"String",
"generateFilename",
"(",
")",
"{",
"String",
"counter",
"=",
"\"\"",
";",
"if",
"(",
"capabilities",
".",
"getInstance",
"(",
")",
">",
"0",
")",
"{",
"counter",
"=",
"\"_\"",
"+",
"capabilities",
".",
"getInstance",
"(",
")",
";",
... | Generates a unique filename, based on the package, class, method name, and invocation count
@return String: the filename | [
"Generates",
"a",
"unique",
"filename",
"based",
"on",
"the",
"package",
"class",
"method",
"name",
"and",
"invocation",
"count"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L213-L219 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.setupFile | private void setupFile() {
if (!new File(directory).exists() && !new File(directory).mkdirs()) {
try {
throw new IOException("Unable to create output directory");
} catch (IOException e) {
log.info(e);
}
}
if (!file.exists()) {
... | java | private void setupFile() {
if (!new File(directory).exists() && !new File(directory).mkdirs()) {
try {
throw new IOException("Unable to create output directory");
} catch (IOException e) {
log.info(e);
}
}
if (!file.exists()) {
... | [
"private",
"void",
"setupFile",
"(",
")",
"{",
"if",
"(",
"!",
"new",
"File",
"(",
"directory",
")",
".",
"exists",
"(",
")",
"&&",
"!",
"new",
"File",
"(",
"directory",
")",
".",
"mkdirs",
"(",
")",
")",
"{",
"try",
"{",
"throw",
"new",
"IOExcep... | Creates the directory and file to hold the test output file | [
"Creates",
"the",
"directory",
"and",
"file",
"to",
"hold",
"the",
"test",
"output",
"file"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L224-L241 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.replaceInFile | private void replaceInFile(String oldText, String newText) {
StringBuilder oldContent = new StringBuilder();
try (FileReader fr = new FileReader(file); BufferedReader reader = new BufferedReader(fr)) {
String line;
while ((line = reader.readLine()) != null) {
old... | java | private void replaceInFile(String oldText, String newText) {
StringBuilder oldContent = new StringBuilder();
try (FileReader fr = new FileReader(file); BufferedReader reader = new BufferedReader(fr)) {
String line;
while ((line = reader.readLine()) != null) {
old... | [
"private",
"void",
"replaceInFile",
"(",
"String",
"oldText",
",",
"String",
"newText",
")",
"{",
"StringBuilder",
"oldContent",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"(",
"FileReader",
"fr",
"=",
"new",
"FileReader",
"(",
"file",
")",
";",
"B... | Replaces an occurrence of a string within a file
@param oldText - the text to be replaced
@param newText - the text to be replaced with | [
"Replaces",
"an",
"occurrence",
"of",
"a",
"string",
"within",
"a",
"file"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L249-L270 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getHtmlForPDFConversion | private String getHtmlForPDFConversion() throws IOException {
StringBuilder oldContent = new StringBuilder();
FileReader fr = new FileReader(file);
try (BufferedReader reader = new BufferedReader(fr)) {
String line;
while ((line = reader.readLine()) != null) {
... | java | private String getHtmlForPDFConversion() throws IOException {
StringBuilder oldContent = new StringBuilder();
FileReader fr = new FileReader(file);
try (BufferedReader reader = new BufferedReader(fr)) {
String line;
while ((line = reader.readLine()) != null) {
... | [
"private",
"String",
"getHtmlForPDFConversion",
"(",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"oldContent",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"FileReader",
"fr",
"=",
"new",
"FileReader",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
... | Removes all elements that cannot be converted to pdf, this method is to be used
before converting the html file to pdf with openhtmltopdf.pdfboxout.PdfRendererBuilder | [
"Removes",
"all",
"elements",
"that",
"cannot",
"be",
"converted",
"to",
"pdf",
"this",
"method",
"is",
"to",
"be",
"used",
"before",
"converting",
"the",
"html",
"file",
"to",
"pdf",
"with",
"openhtmltopdf",
".",
"pdfboxout",
".",
"PdfRendererBuilder"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L276-L307 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.captureEntirePageScreenshot | public String captureEntirePageScreenshot() {
String imageName = generateImageName();
String imageLink = generateImageLink(imageName);
try {
app.takeScreenshot(imageName);
screenshots.add(imageName);
} catch (Exception e) {
log.error(e);
im... | java | public String captureEntirePageScreenshot() {
String imageName = generateImageName();
String imageLink = generateImageLink(imageName);
try {
app.takeScreenshot(imageName);
screenshots.add(imageName);
} catch (Exception e) {
log.error(e);
im... | [
"public",
"String",
"captureEntirePageScreenshot",
"(",
")",
"{",
"String",
"imageName",
"=",
"generateImageName",
"(",
")",
";",
"String",
"imageLink",
"=",
"generateImageLink",
"(",
"imageName",
")",
";",
"try",
"{",
"app",
".",
"takeScreenshot",
"(",
"imageNa... | Captures the entire page screen shot, and created an HTML file friendly
link to place in the output file
@return String: the image link string | [
"Captures",
"the",
"entire",
"page",
"screen",
"shot",
"and",
"created",
"an",
"HTML",
"file",
"friendly",
"link",
"to",
"place",
"in",
"the",
"output",
"file"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L315-L326 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getAction | private String getAction(String check, double waitFor) {
String action = "";
if (waitFor > 0) {
action = "Waiting up to " + waitFor + " seconds " + check;
}
return action;
} | java | private String getAction(String check, double waitFor) {
String action = "";
if (waitFor > 0) {
action = "Waiting up to " + waitFor + " seconds " + check;
}
return action;
} | [
"private",
"String",
"getAction",
"(",
"String",
"check",
",",
"double",
"waitFor",
")",
"{",
"String",
"action",
"=",
"\"\"",
";",
"if",
"(",
"waitFor",
">",
"0",
")",
"{",
"action",
"=",
"\"Waiting up to \"",
"+",
"waitFor",
"+",
"\" seconds \"",
"+",
... | Helper to recordStep, which takes in a check being performed, and determines if a wait is
occuring or not. If no wait, no action is recorded. If a wait was performed, that wait is
added to the check, and provided back as the action
@param check - the check being performed
@param waitFor - how long was something wait... | [
"Helper",
"to",
"recordStep",
"which",
"takes",
"in",
"a",
"check",
"being",
"performed",
"and",
"determines",
"if",
"a",
"wait",
"is",
"occuring",
"or",
"not",
".",
"If",
"no",
"wait",
"no",
"action",
"is",
"recorded",
".",
"If",
"a",
"wait",
"was",
"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L344-L350 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getActual | private String getActual(String actual, double timeTook) {
if (timeTook > 0) {
String lowercase = actual.substring(0, 1).toLowerCase();
actual = "After waiting for " + timeTook + " seconds, " + lowercase + actual.substring(1);
}
return actual;
} | java | private String getActual(String actual, double timeTook) {
if (timeTook > 0) {
String lowercase = actual.substring(0, 1).toLowerCase();
actual = "After waiting for " + timeTook + " seconds, " + lowercase + actual.substring(1);
}
return actual;
} | [
"private",
"String",
"getActual",
"(",
"String",
"actual",
",",
"double",
"timeTook",
")",
"{",
"if",
"(",
"timeTook",
">",
"0",
")",
"{",
"String",
"lowercase",
"=",
"actual",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toLowerCase",
"(",
")",
... | Helper to recordStep, which takes in some result, and appends a time waited, if
appropriate. If timeTook is greater than zero, some time was waited along with
the action, and the returned result will reflect that
@param actual - the actual outcome from the check
@param timeTook - how long something took to run, prov... | [
"Helper",
"to",
"recordStep",
"which",
"takes",
"in",
"some",
"result",
"and",
"appends",
"a",
"time",
"waited",
"if",
"appropriate",
".",
"If",
"timeTook",
"is",
"greater",
"than",
"zero",
"some",
"time",
"was",
"waited",
"along",
"with",
"the",
"action",
... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L362-L368 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.pass | public void pass(String action, String expectedResult, String actualResult) {
passes++;
recordStep(action, expectedResult, actualResult, false, Success.PASS);
} | java | public void pass(String action, String expectedResult, String actualResult) {
passes++;
recordStep(action, expectedResult, actualResult, false, Success.PASS);
} | [
"public",
"void",
"pass",
"(",
"String",
"action",
",",
"String",
"expectedResult",
",",
"String",
"actualResult",
")",
"{",
"passes",
"++",
";",
"recordStep",
"(",
"action",
",",
"expectedResult",
",",
"actualResult",
",",
"false",
",",
"Success",
".",
"PAS... | Records the performed step as a pass to the output file. This includes the
action taken if any, the expected result, and the actual result.
@param action - the step that was performed
@param expectedResult - the result that was expected to occur
@param actualResult - the result that actually occurred | [
"Records",
"the",
"performed",
"step",
"as",
"a",
"pass",
"to",
"the",
"output",
"file",
".",
"This",
"includes",
"the",
"action",
"taken",
"if",
"any",
"the",
"expected",
"result",
"and",
"the",
"actual",
"result",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L418-L421 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.finalizeReporter | public void finalizeReporter(int testStatus) {
// reopen the file
try (FileWriter fw = new FileWriter(file, true); BufferedWriter out = new BufferedWriter(fw)) {
out.write(" </table>\n");
out.write(" </body>\n");
out.write("</html>\n");
} catch (IOException e... | java | public void finalizeReporter(int testStatus) {
// reopen the file
try (FileWriter fw = new FileWriter(file, true); BufferedWriter out = new BufferedWriter(fw)) {
out.write(" </table>\n");
out.write(" </body>\n");
out.write("</html>\n");
} catch (IOException e... | [
"public",
"void",
"finalizeReporter",
"(",
"int",
"testStatus",
")",
"{",
"// reopen the file",
"try",
"(",
"FileWriter",
"fw",
"=",
"new",
"FileWriter",
"(",
"file",
",",
"true",
")",
";",
"BufferedWriter",
"out",
"=",
"new",
"BufferedWriter",
"(",
"fw",
")... | Ends and closes the output test file. The HTML is properly ended, and the
file is analyzed to determine if the test passed or failed, and that
information is updated, along with the overall timing of the test | [
"Ends",
"and",
"closes",
"the",
"output",
"test",
"file",
".",
"The",
"HTML",
"is",
"properly",
"ended",
"and",
"the",
"file",
"is",
"analyzed",
"to",
"determine",
"if",
"the",
"test",
"passed",
"or",
"failed",
"and",
"that",
"information",
"is",
"updated"... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L678-L709 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.addTimeToReport | private void addTimeToReport() {
// record the time
SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
String timeNow = stf.format(new Date());
long totalTime = (new Date()).getTime() - startTime;
long time = totalTime / 1000;
StringBuilder seconds = new StringBuild... | java | private void addTimeToReport() {
// record the time
SimpleDateFormat stf = new SimpleDateFormat("HH:mm:ss");
String timeNow = stf.format(new Date());
long totalTime = (new Date()).getTime() - startTime;
long time = totalTime / 1000;
StringBuilder seconds = new StringBuild... | [
"private",
"void",
"addTimeToReport",
"(",
")",
"{",
"// record the time",
"SimpleDateFormat",
"stf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"HH:mm:ss\"",
")",
";",
"String",
"timeNow",
"=",
"stf",
".",
"format",
"(",
"new",
"Date",
"(",
")",
")",
";",
"long... | Updates the output file with timing information, including run time, and finish time | [
"Updates",
"the",
"output",
"file",
"with",
"timing",
"information",
"including",
"run",
"time",
"and",
"finish",
"time"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L714-L736 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.generatePdf | private void generatePdf() {
File pdfFile = new File(directory, filename + ".pdf");
try (OutputStream os = new FileOutputStream(pdfFile)) {
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.withHtmlContent(getHtmlForPDFConversion(), "file://" + pdfFile.getAbsolutePat... | java | private void generatePdf() {
File pdfFile = new File(directory, filename + ".pdf");
try (OutputStream os = new FileOutputStream(pdfFile)) {
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.withHtmlContent(getHtmlForPDFConversion(), "file://" + pdfFile.getAbsolutePat... | [
"private",
"void",
"generatePdf",
"(",
")",
"{",
"File",
"pdfFile",
"=",
"new",
"File",
"(",
"directory",
",",
"filename",
"+",
"\".pdf\"",
")",
";",
"try",
"(",
"OutputStream",
"os",
"=",
"new",
"FileOutputStream",
"(",
"pdfFile",
")",
")",
"{",
"PdfRen... | Generates a pdf report in the same directory as the html report | [
"Generates",
"a",
"pdf",
"report",
"in",
"the",
"same",
"directory",
"as",
"the",
"html",
"report"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L741-L752 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.generateImageLink | private String generateImageLink(String imageName) {
StringBuilder imageLink = new StringBuilder("<br/>");
if (imageName.length() >= directory.length() + 1) {
imageLink.append(ONCLICK_TOGGLE).
append(imageName.substring(directory.length() + 1)).
append... | java | private String generateImageLink(String imageName) {
StringBuilder imageLink = new StringBuilder("<br/>");
if (imageName.length() >= directory.length() + 1) {
imageLink.append(ONCLICK_TOGGLE).
append(imageName.substring(directory.length() + 1)).
append... | [
"private",
"String",
"generateImageLink",
"(",
"String",
"imageName",
")",
"{",
"StringBuilder",
"imageLink",
"=",
"new",
"StringBuilder",
"(",
"\"<br/>\"",
")",
";",
"if",
"(",
"imageName",
".",
"length",
"(",
")",
">=",
"directory",
".",
"length",
"(",
")"... | Generates the HTML friendly link for the image
@param imageName the name of the image being embedded
@return String: the link for the image which can be written out to the
html file | [
"Generates",
"the",
"HTML",
"friendly",
"link",
"for",
"the",
"image"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L789-L809 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.formatResponse | public static String formatResponse(Response response) {
if (response == null) {
return "";
}
StringBuilder output = new StringBuilder();
if (response.isData()) {
output.append(DIV_I);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
... | java | public static String formatResponse(Response response) {
if (response == null) {
return "";
}
StringBuilder output = new StringBuilder();
if (response.isData()) {
output.append(DIV_I);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
... | [
"public",
"static",
"String",
"formatResponse",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"response",
... | Formats the response parameters to be 'prettily' printed out in HTML
@param response - the http response to be formatted.
@return String: a 'prettily' formatted string that is HTML safe to output | [
"Formats",
"the",
"response",
"parameters",
"to",
"be",
"prettily",
"printed",
"out",
"in",
"HTML"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L834-L851 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.formatKeyPair | public static String formatKeyPair(Map<String, Object> keyPairs) {
if (keyPairs == null) {
return "";
}
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry<String, Object> entry : keyPairs.entrySet()) {
stringBuilder.append(DIV);
stringBu... | java | public static String formatKeyPair(Map<String, Object> keyPairs) {
if (keyPairs == null) {
return "";
}
StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry<String, Object> entry : keyPairs.entrySet()) {
stringBuilder.append(DIV);
stringBu... | [
"public",
"static",
"String",
"formatKeyPair",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"keyPairs",
")",
"{",
"if",
"(",
"keyPairs",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(... | From an object map passed in, building a key value set, properly html
formatted for used in reporting
@param keyPairs - the key value set
@return String: an html formatting string | [
"From",
"an",
"object",
"map",
"passed",
"in",
"building",
"a",
"key",
"value",
"set",
"properly",
"html",
"formatted",
"for",
"used",
"in",
"reporting"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L875-L888 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getRequestPayloadOutput | public static String getRequestPayloadOutput(Request params, File file) {
StringBuilder payload = new StringBuilder();
String uuid = getUUID();
payload.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Payload</a> ");
payload.append(SPAN_ID).append(uuid).append(DISPLAY_NONE);
... | java | public static String getRequestPayloadOutput(Request params, File file) {
StringBuilder payload = new StringBuilder();
String uuid = getUUID();
payload.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Payload</a> ");
payload.append(SPAN_ID).append(uuid).append(DISPLAY_NONE);
... | [
"public",
"static",
"String",
"getRequestPayloadOutput",
"(",
"Request",
"params",
",",
"File",
"file",
")",
"{",
"StringBuilder",
"payload",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"uuid",
"=",
"getUUID",
"(",
")",
";",
"payload",
".",
"append... | Formats the request parameters to be 'prettily' printed out in HTML
@param params - the parameters to be formatted. Either a JSON object, or a
hashmap
@return String: a 'prettily' formatted string that is HTML safe to output | [
"Formats",
"the",
"request",
"parameters",
"to",
"be",
"prettily",
"printed",
"out",
"in",
"HTML"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L897-L926 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getCredentialStringOutput | public static String getCredentialStringOutput(HTTP http) {
if (http == null || !http.useCredentials()) {
return "";
}
StringBuilder credentials = new StringBuilder();
String uuid = getUUID();
credentials.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Credent... | java | public static String getCredentialStringOutput(HTTP http) {
if (http == null || !http.useCredentials()) {
return "";
}
StringBuilder credentials = new StringBuilder();
String uuid = getUUID();
credentials.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Credent... | [
"public",
"static",
"String",
"getCredentialStringOutput",
"(",
"HTTP",
"http",
")",
"{",
"if",
"(",
"http",
"==",
"null",
"||",
"!",
"http",
".",
"useCredentials",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"credentials",
"=",
"new",... | Looks for the simple login credentials, username and password, and if
they are both set, turns that into a string which will be formatted for
HTML to be printed into the output file
@param http - the http object that is making the call
@return String: an HTML formatted string with the username and password -
if they a... | [
"Looks",
"for",
"the",
"simple",
"login",
"credentials",
"username",
"and",
"password",
"and",
"if",
"they",
"are",
"both",
"set",
"turns",
"that",
"into",
"a",
"string",
"which",
"will",
"be",
"formatted",
"for",
"HTML",
"to",
"be",
"printed",
"into",
"th... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L937-L954 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getRequestHeadersOutput | public static String getRequestHeadersOutput(HTTP http) {
if (http == null) {
return "";
}
StringBuilder requestHeaders = new StringBuilder();
String uuid = getUUID();
requestHeaders.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Headers</a> ");
reque... | java | public static String getRequestHeadersOutput(HTTP http) {
if (http == null) {
return "";
}
StringBuilder requestHeaders = new StringBuilder();
String uuid = getUUID();
requestHeaders.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Headers</a> ");
reque... | [
"public",
"static",
"String",
"getRequestHeadersOutput",
"(",
"HTTP",
"http",
")",
"{",
"if",
"(",
"http",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"requestHeaders",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"uuid",
... | Takes the headers set in the HTTP request, and writes them to the output
file, in properly HTML formatted fashion
@param http - the http object that is making the call
@return String: an HTML formatted string with headers | [
"Takes",
"the",
"headers",
"set",
"in",
"the",
"HTTP",
"request",
"and",
"writes",
"them",
"to",
"the",
"output",
"file",
"in",
"properly",
"HTML",
"formatted",
"fashion"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L963-L974 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getResponseHeadersOutput | public static String getResponseHeadersOutput(Response response) {
if (response == null) {
return "";
}
StringBuilder responseHeaders = new StringBuilder();
String uuid = getUUID();
responseHeaders.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Headers</a> ")... | java | public static String getResponseHeadersOutput(Response response) {
if (response == null) {
return "";
}
StringBuilder responseHeaders = new StringBuilder();
String uuid = getUUID();
responseHeaders.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Headers</a> ")... | [
"public",
"static",
"String",
"getResponseHeadersOutput",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"responseHeaders",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String"... | Takes the headers returned in the HTTP response, and writes them to the output
file, in properly HTML formatted fashion
@param response - the response object obtained from the call
@return String: an HTML formatted string with headers | [
"Takes",
"the",
"headers",
"returned",
"in",
"the",
"HTTP",
"response",
"and",
"writes",
"them",
"to",
"the",
"output",
"file",
"in",
"properly",
"HTML",
"formatted",
"fashion"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L983-L994 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getResponseCodeOutput | public static String getResponseCodeOutput(Response response) {
if (response == null) {
return "";
}
StringBuilder responseOutput = new StringBuilder();
String uuid = getUUID();
responseOutput.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Response Status Cod... | java | public static String getResponseCodeOutput(Response response) {
if (response == null) {
return "";
}
StringBuilder responseOutput = new StringBuilder();
String uuid = getUUID();
responseOutput.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Response Status Cod... | [
"public",
"static",
"String",
"getResponseCodeOutput",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"StringBuilder",
"responseOutput",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
... | Takes the response code returned in the HTTP response, and writes them to the output
file, in properly HTML formatted fashion
@param response - the response object obtained from the call
@return String: an HTML formatted string with headers | [
"Takes",
"the",
"response",
"code",
"returned",
"in",
"the",
"HTTP",
"response",
"and",
"writes",
"them",
"to",
"the",
"output",
"file",
"in",
"properly",
"HTML",
"formatted",
"fashion"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L1003-L1014 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getResponseOutput | public static String getResponseOutput(Response response) {
if (response == null || response.getMessage() == null || "".equals(response.getMessage())) {
return "";
}
StringBuilder responseOutput = new StringBuilder();
String uuid = getUUID();
responseOutput.append(ONC... | java | public static String getResponseOutput(Response response) {
if (response == null || response.getMessage() == null || "".equals(response.getMessage())) {
return "";
}
StringBuilder responseOutput = new StringBuilder();
String uuid = getUUID();
responseOutput.append(ONC... | [
"public",
"static",
"String",
"getResponseOutput",
"(",
"Response",
"response",
")",
"{",
"if",
"(",
"response",
"==",
"null",
"||",
"response",
".",
"getMessage",
"(",
")",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"response",
".",
"getMessage",
"("... | Takes the response returned from the HTTP call, and writes it to the output
file, in properly HTML formatted fashion
@param response - the response object obtained from the call
@return String: an HTML formatted string with headers | [
"Takes",
"the",
"response",
"returned",
"from",
"the",
"HTTP",
"call",
"and",
"writes",
"it",
"to",
"the",
"output",
"file",
"in",
"properly",
"HTML",
"formatted",
"fashion"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L1023-L1034 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/utilities/Reporter.java | Reporter.getUUID | public static String getUUID() {
long timeInSeconds = new Date().getTime();
String randomChars = TestCase.getRandomString(10);
return timeInSeconds + "_" + randomChars;
} | java | public static String getUUID() {
long timeInSeconds = new Date().getTime();
String randomChars = TestCase.getRandomString(10);
return timeInSeconds + "_" + randomChars;
} | [
"public",
"static",
"String",
"getUUID",
"(",
")",
"{",
"long",
"timeInSeconds",
"=",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
";",
"String",
"randomChars",
"=",
"TestCase",
".",
"getRandomString",
"(",
"10",
")",
";",
"return",
"timeInSeconds",
... | Generates a unique id
@return String: a random string with timestamp | [
"Generates",
"a",
"unique",
"id"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/utilities/Reporter.java#L1041-L1045 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.url | public String url() {
try {
return driver.getCurrentUrl();
} catch (Exception e) {
log.warn(e);
return null;
}
} | java | public String url() {
try {
return driver.getCurrentUrl();
} catch (Exception e) {
log.warn(e);
return null;
}
} | [
"public",
"String",
"url",
"(",
")",
"{",
"try",
"{",
"return",
"driver",
".",
"getCurrentUrl",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"warn",
"(",
"e",
")",
";",
"return",
"null",
";",
"}",
"}"
] | Retrieves the current url of the application.
@return String - current application url | [
"Retrieves",
"the",
"current",
"url",
"of",
"the",
"application",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L63-L70 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.title | public String title() {
try {
return driver.getTitle();
} catch (Exception e) {
log.warn(e);
return null;
}
} | java | public String title() {
try {
return driver.getTitle();
} catch (Exception e) {
log.warn(e);
return null;
}
} | [
"public",
"String",
"title",
"(",
")",
"{",
"try",
"{",
"return",
"driver",
".",
"getTitle",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"warn",
"(",
"e",
")",
";",
"return",
"null",
";",
"}",
"}"
] | Retrieves the title of the current page the application is on
@return String - current application title | [
"Retrieves",
"the",
"title",
"of",
"the",
"current",
"page",
"the",
"application",
"is",
"on"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L77-L84 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.htmlSource | public String htmlSource() {
try {
return driver.getPageSource();
} catch (Exception e) {
log.warn(e);
return null;
}
} | java | public String htmlSource() {
try {
return driver.getPageSource();
} catch (Exception e) {
log.warn(e);
return null;
}
} | [
"public",
"String",
"htmlSource",
"(",
")",
"{",
"try",
"{",
"return",
"driver",
".",
"getPageSource",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"warn",
"(",
"e",
")",
";",
"return",
"null",
";",
"}",
"}"
] | Retrieves the full html source of the current page the application is on
@return String - current application page source | [
"Retrieves",
"the",
"full",
"html",
"source",
"of",
"the",
"current",
"page",
"the",
"application",
"is",
"on"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L91-L98 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.eval | public Object eval(String javascriptFunction) {
try {
JavascriptExecutor js = (JavascriptExecutor) driver;
return js.executeScript(javascriptFunction);
} catch (NoSuchMethodError | Exception e) {
log.warn(e);
return null;
}
} | java | public Object eval(String javascriptFunction) {
try {
JavascriptExecutor js = (JavascriptExecutor) driver;
return js.executeScript(javascriptFunction);
} catch (NoSuchMethodError | Exception e) {
log.warn(e);
return null;
}
} | [
"public",
"Object",
"eval",
"(",
"String",
"javascriptFunction",
")",
"{",
"try",
"{",
"JavascriptExecutor",
"js",
"=",
"(",
"JavascriptExecutor",
")",
"driver",
";",
"return",
"js",
".",
"executeScript",
"(",
"javascriptFunction",
")",
";",
"}",
"catch",
"(",... | Executes a provided script, and returns the output of that script. If
there is an error executing this script, a null value will be returned.
@param javascriptFunction - the javascript function that is going to be executed
@return Object: any resultant output from the javascript command | [
"Executes",
"a",
"provided",
"script",
"and",
"returns",
"the",
"output",
"of",
"that",
"script",
".",
"If",
"there",
"is",
"an",
"error",
"executing",
"this",
"script",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L107-L115 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.confirmation | public String confirmation() {
if (!is.confirmationPresent()) {
return null;
}
try {
Alert alert = driver.switchTo().alert();
return alert.getText();
} catch (Exception e) {
log.warn(e);
return null;
}
} | java | public String confirmation() {
if (!is.confirmationPresent()) {
return null;
}
try {
Alert alert = driver.switchTo().alert();
return alert.getText();
} catch (Exception e) {
log.warn(e);
return null;
}
} | [
"public",
"String",
"confirmation",
"(",
")",
"{",
"if",
"(",
"!",
"is",
".",
"confirmationPresent",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"Alert",
"alert",
"=",
"driver",
".",
"switchTo",
"(",
")",
".",
"alert",
"(",
")",
";"... | Retrieves the content of a confirmation present on the page. If the
confirmation doesn't exist, a null value will be returned.
@return String - the content of the confirmation | [
"Retrieves",
"the",
"content",
"of",
"a",
"confirmation",
"present",
"on",
"the",
"page",
".",
"If",
"the",
"confirmation",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L142-L153 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.cookie | public Cookie cookie(String expectedCookieName) {
try {
return driver.manage().getCookieNamed(expectedCookieName);
} catch (Exception e) {
log.warn(e);
return null;
}
} | java | public Cookie cookie(String expectedCookieName) {
try {
return driver.manage().getCookieNamed(expectedCookieName);
} catch (Exception e) {
log.warn(e);
return null;
}
} | [
"public",
"Cookie",
"cookie",
"(",
"String",
"expectedCookieName",
")",
"{",
"try",
"{",
"return",
"driver",
".",
"manage",
"(",
")",
".",
"getCookieNamed",
"(",
"expectedCookieName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"... | Retrieves the full cookie in the application with the provided
cookieName. If the cookie doesn't exist, a null value will be returned.
@param expectedCookieName - the name of the cookie
@return Cookie - the cookie | [
"Retrieves",
"the",
"full",
"cookie",
"in",
"the",
"application",
"with",
"the",
"provided",
"cookieName",
".",
"If",
"the",
"cookie",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L181-L188 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.cookieValue | public String cookieValue(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getValue();
}
return null;
} | java | public String cookieValue(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getValue();
}
return null;
} | [
"public",
"String",
"cookieValue",
"(",
"String",
"expectedCookieName",
")",
"{",
"Cookie",
"cookie",
"=",
"cookie",
"(",
"expectedCookieName",
")",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"return",
"cookie",
".",
"getValue",
"(",
")",
";",
"}",
... | Retrieves the cookie value in the application with the provided
cookieName. If the cookie doesn't exist, a null value will be returned.
@param expectedCookieName - the name of the cookie
@return String - the value of the cookie | [
"Retrieves",
"the",
"cookie",
"value",
"in",
"the",
"application",
"with",
"the",
"provided",
"cookieName",
".",
"If",
"the",
"cookie",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L197-L203 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.cookiePath | public String cookiePath(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getPath();
}
return null;
} | java | public String cookiePath(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getPath();
}
return null;
} | [
"public",
"String",
"cookiePath",
"(",
"String",
"expectedCookieName",
")",
"{",
"Cookie",
"cookie",
"=",
"cookie",
"(",
"expectedCookieName",
")",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"return",
"cookie",
".",
"getPath",
"(",
")",
";",
"}",
... | Retrieves the cookie path in the application with the provided
cookieName. If the cookie doesn't exist, a null value will be returned.
@param expectedCookieName - the name of the cookie
@return String - the path of the cookie | [
"Retrieves",
"the",
"cookie",
"path",
"in",
"the",
"application",
"with",
"the",
"provided",
"cookieName",
".",
"If",
"the",
"cookie",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L212-L218 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.cookieDomain | public String cookieDomain(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getDomain();
}
return null;
} | java | public String cookieDomain(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getDomain();
}
return null;
} | [
"public",
"String",
"cookieDomain",
"(",
"String",
"expectedCookieName",
")",
"{",
"Cookie",
"cookie",
"=",
"cookie",
"(",
"expectedCookieName",
")",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"return",
"cookie",
".",
"getDomain",
"(",
")",
";",
"}"... | Retrieves the cookie domain in the application with the provided
cookieName. If the cookie doesn't exist, a null value will be returned.
@param expectedCookieName - the name of the cookie
@return String - the domain of the cookie | [
"Retrieves",
"the",
"cookie",
"domain",
"in",
"the",
"application",
"with",
"the",
"provided",
"cookieName",
".",
"If",
"the",
"cookie",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L227-L233 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/Get.java | Get.cookieExpiration | public Date cookieExpiration(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getExpiry();
}
return null;
} | java | public Date cookieExpiration(String expectedCookieName) {
Cookie cookie = cookie(expectedCookieName);
if (cookie != null) {
return cookie.getExpiry();
}
return null;
} | [
"public",
"Date",
"cookieExpiration",
"(",
"String",
"expectedCookieName",
")",
"{",
"Cookie",
"cookie",
"=",
"cookie",
"(",
"expectedCookieName",
")",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"return",
"cookie",
".",
"getExpiry",
"(",
")",
";",
"... | Retrieves the cookie expiration in the application with the provided
cookieName. If the cookie doesn't exist, a null value will be returned.
@param expectedCookieName - the name of the cookie
@return String - the expiration of the cookie | [
"Retrieves",
"the",
"cookie",
"expiration",
"in",
"the",
"application",
"with",
"the",
"provided",
"cookieName",
".",
"If",
"the",
"cookie",
"doesn",
"t",
"exist",
"a",
"null",
"value",
"will",
"be",
"returned",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/Get.java#L242-L248 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.urlEquals | public void urlEquals(double seconds, String expectedURL) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
WebDriverWait wait = new WebDriverWait(app.getDriver(), (long) seconds, DEFAULT_POLLING_INTERVAL);
wait.until(ExpectedConditions.urlToBe(expectedURL));
... | java | public void urlEquals(double seconds, String expectedURL) {
double end = System.currentTimeMillis() + (seconds * 1000);
try {
WebDriverWait wait = new WebDriverWait(app.getDriver(), (long) seconds, DEFAULT_POLLING_INTERVAL);
wait.until(ExpectedConditions.urlToBe(expectedURL));
... | [
"public",
"void",
"urlEquals",
"(",
"double",
"seconds",
",",
"String",
"expectedURL",
")",
"{",
"double",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"(",
"seconds",
"*",
"1000",
")",
";",
"try",
"{",
"WebDriverWait",
"wait",
"=",
"ne... | Asserts that the provided URL equals the actual URL the application is
currently on. This information will be logged and recorded, with a
screenshot for traceability and added debugging support.
@param seconds the number of seconds to wait
@param expectedURL - the expectedURL to wait for | [
"Asserts",
"that",
"the",
"provided",
"URL",
"equals",
"the",
"actual",
"URL",
"the",
"application",
"is",
"currently",
"on",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
"screenshot",
"for",
"traceability",
"and",
"added... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L348-L358 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.popup | private double popup(double seconds) {
// wait for up to XX seconds for the error message
double end = System.currentTimeMillis() + (seconds * 1000);
WebDriverWait wait = new WebDriverWait(app.getDriver(), (long) seconds, DEFAULT_POLLING_INTERVAL);
wait.until(ExpectedConditions.alertIsPr... | java | private double popup(double seconds) {
// wait for up to XX seconds for the error message
double end = System.currentTimeMillis() + (seconds * 1000);
WebDriverWait wait = new WebDriverWait(app.getDriver(), (long) seconds, DEFAULT_POLLING_INTERVAL);
wait.until(ExpectedConditions.alertIsPr... | [
"private",
"double",
"popup",
"(",
"double",
"seconds",
")",
"{",
"// wait for up to XX seconds for the error message",
"double",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"(",
"seconds",
"*",
"1000",
")",
";",
"WebDriverWait",
"wait",
"=",
... | Wait for a popup to be present, and
then returns the amount of time that was waited
@param seconds - maximum time to wait in seconds
@return double - the total time waited | [
"Wait",
"for",
"a",
"popup",
"to",
"be",
"present",
"and",
"then",
"returns",
"the",
"amount",
"of",
"time",
"that",
"was",
"waited"
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L402-L408 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.alertPresent | public void alertPresent(double seconds) {
try {
double timeTook = popup(seconds);
checkAlertPresent(seconds, timeTook);
} catch (TimeoutException e) {
checkAlertPresent(seconds, seconds);
}
} | java | public void alertPresent(double seconds) {
try {
double timeTook = popup(seconds);
checkAlertPresent(seconds, timeTook);
} catch (TimeoutException e) {
checkAlertPresent(seconds, seconds);
}
} | [
"public",
"void",
"alertPresent",
"(",
"double",
"seconds",
")",
"{",
"try",
"{",
"double",
"timeTook",
"=",
"popup",
"(",
"seconds",
")",
";",
"checkAlertPresent",
"(",
"seconds",
",",
"timeTook",
")",
";",
"}",
"catch",
"(",
"TimeoutException",
"e",
")",... | Asserts that an alert is present on the page. This information will be
logged and recorded, with a screenshot for traceability and added
debugging support.
@param seconds the number of seconds to wait | [
"Asserts",
"that",
"an",
"alert",
"is",
"present",
"on",
"the",
"page",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
"screenshot",
"for",
"traceability",
"and",
"added",
"debugging",
"support",
"."
] | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L459-L466 | train |
Coveros/selenified | src/main/java/com/coveros/selenified/application/WaitFor.java | WaitFor.alertNotPresent | public void alertNotPresent(double seconds) {
try {
double timeTook = noPopup(seconds);
checkAlertNotPresent(seconds, timeTook);
} catch (TimeoutException e) {
checkAlertNotPresent(seconds, seconds);
}
} | java | public void alertNotPresent(double seconds) {
try {
double timeTook = noPopup(seconds);
checkAlertNotPresent(seconds, timeTook);
} catch (TimeoutException e) {
checkAlertNotPresent(seconds, seconds);
}
} | [
"public",
"void",
"alertNotPresent",
"(",
"double",
"seconds",
")",
"{",
"try",
"{",
"double",
"timeTook",
"=",
"noPopup",
"(",
"seconds",
")",
";",
"checkAlertNotPresent",
"(",
"seconds",
",",
"timeTook",
")",
";",
"}",
"catch",
"(",
"TimeoutException",
"e"... | Waits up to the provided wait time for an alert is not present on the page. This information will
be logged and recorded, with a screenshot for traceability and added
debugging support.
@param seconds the number of seconds to wait | [
"Waits",
"up",
"to",
"the",
"provided",
"wait",
"time",
"for",
"an",
"alert",
"is",
"not",
"present",
"on",
"the",
"page",
".",
"This",
"information",
"will",
"be",
"logged",
"and",
"recorded",
"with",
"a",
"screenshot",
"for",
"traceability",
"and",
"adde... | 396cc1f010dd69eed33cc5061c41253de246a4cd | https://github.com/Coveros/selenified/blob/396cc1f010dd69eed33cc5061c41253de246a4cd/src/main/java/com/coveros/selenified/application/WaitFor.java#L475-L482 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.