protractor-screenshoter-plugin
protractor-screenshoter-plugin copied to clipboard
Improvement Request - Direct logging
Hi there!
Thanks for submitting an issue to Protractor Screenshoter Plugin.
To help us help you better, please do the following before submitting an issue:
- Make sure you are not asking a usage or debugging question. If you are, use StackOverflow, or Gitter to get help.
- Provide a minimally reduced test case. This makes it much more likely that your bug will be fixed. Please follow CONTRIBUTING.md.
- Fill in the information that corresponds to your type of issue below.
- Delete this intro and any unrelated text :smile: (if you do not we'll assume you haven't read these instructions and automatically close the issue.)
Bug report
- Your protractor configuration file
- Protractor Version: ``
- Browser(s): ``
- Node Version: ``
- Angular Version: ``
- Operating System and Version ``
- A relevant example test
- Output from running the test
- Steps to reproduce the bug
Feature Request
- Reasons for adopting new feature
- Is this a breaking change? (How will this affect existing functionality)
Hi Guys,
I love the plugin it does most of what I want to do, but there is one thing that I think would be really helpful. In my tests, I typically have an action followed by a verification. For example, enter text into an input box then verify (expect) the value to be in the textbox.
The plugin seems to log only the spec. If I write a verification step in my tests, the logging shows a pass even if my verification step fails. I have tried several methods to get the verification step to log, but am not able to.
In my selenium tests, I wrote my own logging module which would log every step and every verification so that I could report exactly what the test is doing. I would like to do the same in protractor using this plugin if possible.
Here is an example of a test step in my page object file:
async enterGroupName(groupName?){
try{
await UserActions.sendKeysByText(this.groupNameTextBox, groupName? groupName : groupData.createGroupData.groupName);
await this.verifyValue(this.groupNameTextBox,groupData.createGroupData.groupName);
}
catch(e){
expect(e).toBeNull();
console.log(e);
}
}
And here is my verify method:
async verifyValue(locator, text: any){
describe(this.newMethod(),() => {
it('Entered Text should match actual text', () => {
return Promise.resolve(locator.getAttribute('value')).then(function(locatorText){
expect(locatorText).toEqual(text);
});
});
});
}
private newMethod(): string {
return 'ExperimentsComponent';
}