Skip to content
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

Improvement Request - Direct logging #89

Open
SEISENREICH1 opened this issue May 8, 2019 · 1 comment
Open

Improvement Request - Direct logging #89

SEISENREICH1 opened this issue May 8, 2019 · 1 comment

Comments

@SEISENREICH1
Copy link

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:

  1. Make sure you are not asking a usage or debugging question. If you are, use StackOverflow, or Gitter to get help.
  2. Provide a minimally reduced test case. This makes it much more likely that your bug will be fixed.
    Please follow CONTRIBUTING.md.
  3. Fill in the information that corresponds to your type of issue below.
  4. Delete this intro and any unrelated text 😄 (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)
@SEISENREICH1
Copy link
Author

SEISENREICH1 commented May 8, 2019

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';
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant