-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebFixture can now read external browserSetup files #83
base: master
Are you sure you want to change the base?
Conversation
// First try to resolve the file through environment variable | ||
result = getResourceOverEnvironmentVariable(browserSetupFilePath); | ||
if (StringUtils.isNotBlank(result)) { | ||
logger.debug("Browser capabilities read from file : {}", browserSetupFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be trace
result = CharStreams.toString(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); | ||
|
||
} catch (IOException e) { | ||
logger.info("The file with the name {} can not be read in the resource folder." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace and then (re)throw the exception. the caller should then wrap this in a fixture exception
// throw new FixtureException("file could not be found in resource folder", | ||
// FixtureException.keyValues("fileName", fileName)); | ||
} catch (NullPointerException e) { | ||
logger.error("The file with the name {} can not be found in the resource folder.", fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace and then (re)throw the exception. the caller should then wrap this in a fixture exception
/** | ||
* For reading content of a JSON-File where the path is defined through the environment variable | ||
* <code>TEST_EDITOR_BROWSER_SETUP_PATH</code>.<br> | ||
* Usage under Linux : Set TEST_EDITOR_BROWSER_SETUP_PATH=~/your_prefered_folder/fileName.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no set, rather export
if (StringUtils.isNotBlank(path)) { | ||
fileContent = FileUtils.readFileToString(new File(path), StandardCharsets.UTF_8); | ||
} else { | ||
logger.debug("Can not find environment variable '{}' with path entry for browser " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace
@@ -61,6 +80,53 @@ public void readCapabilitySuccesful() throws Exception { | |||
logger.debug(" ######## End of Test readCapabilitySuccesful ########"); | |||
|
|||
} | |||
|
|||
private void getBrowserSetupFile() throws FixtureException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split test in two parts
No description provided.