q2ebanking / boa-constrictor

Boa Constrictor is a C# implementation of the Screenplay Pattern. Its primary use case is Web UI and REST API test automation. Boa Constrictor helps you make better interactions for better automation!
https://q2ebanking.github.io/boa-constrictor/
Other
118 stars 40 forks source link

As a developer, `attempts to` should be logged as `Trace`, so that the Screenplay log can be easily filtered. #257

Open Pressacco opened 1 year ago

Pressacco commented 1 year ago

Description

Intent

Extract a test summary, by filtering the Screenplay log by severity.

This could be accomplished by logging the following as Trace:

Alternatives

  1. Could create a separate log file at run-time, but why bother?

Anything else?

Expected

The log file after Trace messages has been filtered out:

Adding Ability for Screenplay Actor 'Andy' to browse the Web with OpenQA.Selenium.Chrome.ChromeDriver
Screenplay Actor 'Andy' successfully did navigate browser to 'https://www.duckduckgo.com/'
Screenplay Actor 'Andy' observed that the wait until existence of 'DuckDuckGo Search Input' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' observed that the HTML attribute of 'value' for 'DuckDuckGo Search Input' was 
Screenplay Actor 'Andy' observed that the wait until appearance of 'DuckDuckGo Search Input' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' successfully did clear using backspaces, then send keys 'panda' to DuckDuckGo Search Input
Screenplay Actor 'Andy' observed that the wait until appearance of 'DuckDuckGo Search Button' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' successfully did click on 'DuckDuckGo Search Button'
Screenplay Actor 'Andy' successfully did Boa.Constrictor.Example.SearchDuckDuckGo
Screenplay Actor 'Andy' observed that the wait until appearance of 'DuckDuckGo Result Page Links' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' successfully did quit the WebDriver

Actual

The current Screenplay log file:

Screenplay Actor 'Andy' attempts to navigate browser to 'https://www.duckduckgo.com/'
Screenplay Actor 'Andy' successfully did navigate browser to 'https://www.duckduckgo.com/'
Screenplay Actor 'Andy' asking for HTML attribute of 'value' for 'DuckDuckGo Search Input'
Screenplay Actor 'Andy' asks for wait until existence of 'DuckDuckGo Search Input' is equal to 'True'
Screenplay Actor 'Andy' observed that the wait until existence of 'DuckDuckGo Search Input' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' observed that the HTML attribute of 'value' for 'DuckDuckGo Search Input' was 
Screenplay Actor 'Andy' attempts to Boa.Constrictor.Example.SearchDuckDuckGo
Screenplay Actor 'Andy' attempts to clear using backspaces, then send keys 'panda' to DuckDuckGo Search Input
Screenplay Actor 'Andy' asks for wait until appearance of 'DuckDuckGo Search Input' is equal to 'True'
Screenplay Actor 'Andy' observed that the wait until appearance of 'DuckDuckGo Search Input' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' successfully did clear using backspaces, then send keys 'panda' to DuckDuckGo Search Input
Screenplay Actor 'Andy' attempts to click on 'DuckDuckGo Search Button'
Screenplay Actor 'Andy' asks for wait until appearance of 'DuckDuckGo Search Button' is equal to 'True'
Screenplay Actor 'Andy' observed that the wait until appearance of 'DuckDuckGo Search Button' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' successfully did click on 'DuckDuckGo Search Button'
Screenplay Actor 'Andy' successfully did Boa.Constrictor.Example.SearchDuckDuckGo
Screenplay Actor 'Andy' asks for wait until appearance of 'DuckDuckGo Result Page Links' is equal to 'True'
Screenplay Actor 'Andy' observed that the wait until appearance of 'DuckDuckGo Result Page Links' is equal to 'True' for up to 30s was True
Screenplay Actor 'Andy' attempts to quit the WebDriver
Screenplay Actor 'Andy' successfully did quit the WebDriver

Commitments

Pressacco commented 1 year ago

The proposed change, and subsequent unit tests, are related to:

AutomationPanda commented 1 year ago

This is a really good idea.