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

recording ui-session-id for report portal logging #13055

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

omkarkhatavkar
Copy link

@omkarkhatavkar omkarkhatavkar commented Nov 8, 2023

Problem Statement

Currently, We are unable to retrieve the Selenium UI session ID from the Airgun GitHub repository and integrate it into our automation testing tool, Robottelo. This session ID is crucial because during the test recording process, videos are generated by the Selenium Airgun repository, and these videos are associated with specific UI session IDs. To improve our testing workflow and enhance the usability of our test results, we need to establish a mechanism that allows us to access this session ID within Robottelo and incorporate it into the JUnit XML results. By doing so, we can leverage the power of the Report Portal logging system, enabling other team members to easily locate and access the video links associated with each test result for comprehensive test result review.

Solution

  • The ui_session_record_property fixture is now function-scoped to ensure it is created once per test function.
  • The fixture uses record_property to load properties like video_link and session_id.
  • The ui_session_record_property fixture returns a Satellite instance with an associated AirgunSession instance, including the updated ui_session_id attribute.

Airgun PR

SatelliteQE/airgun#1038

@omkarkhatavkar omkarkhatavkar requested a review from a team as a code owner November 8, 2023 04:36
@omkarkhatavkar omkarkhatavkar marked this pull request as draft November 8, 2023 04:37
@omkarkhatavkar omkarkhatavkar added CherryPick PR needs CherryPick to previous branches 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 labels Nov 8, 2023
@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -n 2 tests/foreman/ui/test_settings.py

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -n 2 tests/foreman/ui/test_settings.py
pod_resources_size: large

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -n 2 tests/foreman/ui/test_settings.py
pod_resources_size: large

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -n 2 tests/foreman/ui/test_settings.py
pod_resources_size: large

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -n 2 tests/foreman/ui/test_settings.py
pod_resources_size: large
airgun: 1038

@omkarkhatavkar omkarkhatavkar marked this pull request as ready for review November 16, 2023 17:46
@omkarkhatavkar omkarkhatavkar requested a review from a team as a code owner November 16, 2023 17:46
@omkarkhatavkar
Copy link
Author

Although PRT failed for UI tests that are unrelated, we are able to get the video urls properties and session-id's

image

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: -n 2 tests/foreman/ui/test_acs.py
pod_resources_size: extra_large
airgun: 1038

@omkarkhatavkar
Copy link
Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_host.py
pod_resources_size: extra_large
airgun: 1038

@omkarkhatavkar omkarkhatavkar added the Framework Changes A modification of the robottelo framework label Nov 17, 2023
@omkarkhatavkar
Copy link
Author

Although PRT failed for UI tests that are unrelated, we are able to get the video urls properties and session-id's

image

Copy link
Member

@jyejare jyejare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Great!

BTW I would incline towards creating pytest plugin out of it rather than having conftest file with same contents at each sub-directory (like ui, destructor you are doing). In plugin you can choose to filter the path for the tests and then record the property for ui session.

With this pytest plugin, we can open it in future for everyone.

@omkarkhatavkar
Copy link
Author

Looks Great!

BTW I would incline towards creating pytest plugin out of it rather than having conftest file with same contents at each sub-directory (like ui, destructor you are doing). In plugin you can choose to filter the path for the tests and then record the property for ui session.

With this pytest plugin, we can open it in future for everyone.

For now, I'm moving this to the tests/foreman/ level. I'm currently trying to avoid a plugin as it can not be run as a hook because it requires a record_property function scope fixture.

@omkarkhatavkar omkarkhatavkar added the 6.15.z Introduced in or relating directly to Satellite 6.15 label Nov 23, 2023
@jyejare jyejare added 6.15.z Introduced in or relating directly to Satellite 6.15 and removed 6.15.z Introduced in or relating directly to Satellite 6.15 labels Nov 24, 2023
@jyejare jyejare merged commit 3e4abae into SatelliteQE:master Nov 24, 2023
8 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 24, 2023
* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check

(cherry picked from commit 3e4abae)
github-actions bot pushed a commit that referenced this pull request Nov 24, 2023
* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check

(cherry picked from commit 3e4abae)
github-actions bot pushed a commit that referenced this pull request Nov 24, 2023
* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check

(cherry picked from commit 3e4abae)
Gauravtalreja1 pushed a commit that referenced this pull request Nov 24, 2023
recording ui-session-id for report portal logging (#13055)

* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check

(cherry picked from commit 3e4abae)

Co-authored-by: Omkar Khatavkar <okhatavkar007@gmail.com>
Gauravtalreja1 pushed a commit that referenced this pull request Nov 24, 2023
recording ui-session-id for report portal logging (#13055)

* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check

(cherry picked from commit 3e4abae)

Co-authored-by: Omkar Khatavkar <okhatavkar007@gmail.com>
Gauravtalreja1 pushed a commit that referenced this pull request Nov 24, 2023
recording ui-session-id for report portal logging (#13055)

* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check

(cherry picked from commit 3e4abae)

Co-authored-by: Omkar Khatavkar <okhatavkar007@gmail.com>
omkarkhatavkar added a commit to omkarkhatavkar/robottelo that referenced this pull request Nov 27, 2023
* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check
Gauravtalreja1 pushed a commit that referenced this pull request Nov 29, 2023
recording ui-session-id for report portal logging (#13055)

* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
* recording ui-session-id for report portal logging

* moving the fixture to common location and adding fspath check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches Framework Changes A modification of the robottelo framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants