Skip to content

Commit

Permalink
QE-13273 Change the browser console log file suffix (#362)
Browse files Browse the repository at this point in the history
The browser console log file is not recognized as text file by S3.
Change the suffix to .txt instead.
  • Loading branch information
ddl-xin authored Sep 7, 2023
1 parent 8cd0203 commit 6012dfa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project closely adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.161.0
- Change - add .txt as browser console log file suffix

## 0.160.0
- Add - drag and drop file upload step

Expand Down
4 changes: 2 additions & 2 deletions features/browser/console_logs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Feature: Browser console logs
#
Given I skip this scenario if the current browser is not "chrome"
When I run the command "cucu run data/features/scenario_with_console_logs.feature --results {CUCU_RESULTS_DIR}/console-logging" and save stdout to "STDOUT" and expect exit code "0"
And I should see the file at "{CUCU_RESULTS_DIR}/console-logging/Feature with console logs/Scenario with console logs/logs/browser_console.log" matches the following:
And I should see the file at "{CUCU_RESULTS_DIR}/console-logging/Feature with console logs/Scenario with console logs/logs/browser_console.log.txt" matches the following:
"""
.* "INFO", "message": ".*/console_logging.html 4:12 \\"this is a regular log\\"", .*
.* "SEVERE", "message": ".*/console_logging.html 5:12 \\"this is an error log\\"", .*
.* "DEBUG", "message": ".*/console_logging.html 6:12 \\"this is a debug log\\"", .*
.* "WARNING", "message": ".*/console_logging.html 7:12 \\"this is a warn log\\"", .*
"""
And I should see the file at "{CUCU_RESULTS_DIR}/console-logging/Feature with console logs/Scenario without console logs/logs/browser_console.log" is equal to the following:
And I should see the file at "{CUCU_RESULTS_DIR}/console-logging/Feature with console logs/Scenario without console logs/logs/browser_console.log.txt" is equal to the following:
"""
"""
4 changes: 2 additions & 2 deletions features/cli/report_basics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ Feature: Report basics
And I click the link "Feature with console logs"
And I click the button "Scenario with console logs"
And I click the button "Logs"
Then I should see the button "browser_console.log"
When I click the button "browser_console.log"
Then I should see the button "browser_console.log.txt"
When I click the button "browser_console.log.txt"
Then I wait to see the text "this is a regular log"
And I should see the text "this is an error log"
And I should see the text "this is a debug log"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cucu"
version = "0.160.0"
version = "0.161.0"
license = "MIT"
description = "Easy BDD web testing"
authors = ["Domino Data Lab <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion src/cucu/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def after_scenario(ctx, scenario):
for browser in ctx.browsers:
# save the browser logs to the current scenarios results directory
browser_log_filepath = os.path.join(
ctx.scenario_logs_dir, "browser_console.log"
ctx.scenario_logs_dir, "browser_console.log.txt"
)

os.makedirs(os.path.dirname(browser_log_filepath), exist_ok=True)
Expand Down

0 comments on commit 6012dfa

Please sign in to comment.