Skip to content

Commit

Permalink
Merge pull request #723 from bugsnag/tms/skip-hooks
Browse files Browse the repository at this point in the history
Skip hooks for skipped scenarios
  • Loading branch information
twometresteve authored Feb 18, 2025
2 parents 4cb5f09 + 5e90614 commit 5a839d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
12 changes: 4 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# TBD
# 9.23.0 - 2025/02/18

## Enhancements

- Allow multiple browser options to be presented to BitBar and BrowserStack test runs [712](https://github.com/bugsnag/maze-runner/pull/712)
- Output device information as a JSON file during appium tests [717](https://github.com/bugsnag/maze-runner/pull/717)
- Failed driver guards added to File Manager API [709](https://github.com/bugsnag/maze-runner/pull/709)
- Add App Manager API [712](https://github.com/bugsnag/maze-runner/pull/712)
- Add Device Manager API [712](https://github.com/bugsnag/maze-runner/pull/713)
- Add terminate and activate methods to App Manager API [716](https://github.com/bugsnag/maze-runner/pull/716)

## Fixes

- Do not run Cucumber `Before` and `After` hooks when skipping scenarios [723](https://github.com/bugsnag/maze-runner/pull/723)
- Ensure we parse the correct line from AWS lambda responses [722](https://github.com/bugsnag/maze-runner/pull/722)

# 9.23.0 - 2025/01/XX

## Enhancements

- Allow multiple browser options to be presented to BitBar and BrowserStack test runs [712](https://github.com/bugsnag/maze-runner/pull/712)
- Output device information as a JSON file during appium tests [717](https://github.com/bugsnag/maze-runner/pull/717)

# 9.22.0 - 2025/01/08

## Enhancements
Expand Down
9 changes: 8 additions & 1 deletion lib/features/support/internal_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
require 'uri'

BeforeAll do

Maze.check = Maze::Checks::AssertCheck.new

# Infer mode of operation from config, one of:
Expand Down Expand Up @@ -101,6 +100,8 @@

# Before each scenario
Before do |scenario|
next if scenario.status == :skipped

Maze.scenario = Maze::Api::Cucumber::Scenario.new(scenario)

# Skip scenario if the driver it needs has failed
Expand Down Expand Up @@ -133,6 +134,8 @@

# General processing to be run after each scenario
After do |scenario|
next if scenario.status == :skipped

# If we're running on macos, take a screenshot if the scenario fails
if Maze.config.os == "macos" && scenario.status == :failed
Maze::MacosUtils.capture_screen(scenario)
Expand Down Expand Up @@ -225,6 +228,8 @@ def output_received_requests(request_type)
#
# Furthermore, this hook should appear after the general hook as they are executed in reverse order by Cucumber.
After do |scenario|
next if scenario.status == :skipped

# Call any pre_complete hooks registered by the client
Maze.hooks.call_pre_complete scenario

Expand All @@ -239,6 +244,8 @@ def output_received_requests(request_type)
# Test all requests against schemas or extra validation rules. These will only run if the schema/validation is
# specified for the specific endpoint
After do |scenario|
next if scenario.status == :skipped

['error', 'session', 'build', 'trace'].each do |endpoint|
Maze::Schemas::Validator.validate_payload_elements(Maze::Server.list_for(endpoint), endpoint)
end
Expand Down

0 comments on commit 5a839d9

Please sign in to comment.