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

fix: screenshots every session for easy debugging #3711

Merged
merged 3 commits into from
Jul 1, 2023

Conversation

kobenguyent
Copy link
Collaborator

@kobenguyent kobenguyent commented Jun 27, 2023

Motivation/Description of the PR

  • Currently only screenshot of the active session is saved, this PR aims to save the screenshot of every session for easy debugging
Feature('ShadowDom');

Scenario('Input a text in the input box and after search validate one of the book title',  async ({ I }) => {
    I.amOnPage('/')
    I.fillField('#input', 'Science')
    I.pressKey('Enter')
    I.waitForElement('h2[class="title"]')
    await I.seeElementInDOM('h2[class="title"]')

    await session('new session', () => {
        I.amOnPage('https://codecept.io');
        I.see('123');
    })

    await session('another session', () => {
        I.amOnPage('https://google.com');
        I.see('123');
    })
});
  Artifacts:
  - screenshot: /Users/thanh.nguyen/Desktop/codeceptjs-shadow-dom-fun/output/Input_a_text_in_the_input_box_and_after_search_validate_one_of_the_book_title.failed.png
  - new session_screenshot: /Users/thanh.nguyen/Desktop/codeceptjs-shadow-dom-fun/output/new session_Input_a_text_in_the_input_box_and_after_search_validate_one_of_the_book_title.failed.png
  - another session_screenshot: /Users/thanh.nguyen/Desktop/codeceptjs-shadow-dom-fun/output/another session_Input_a_text_in_the_input_box_and_after_search_validate_one_of_the_book_title.failed.png

Screenshot 2023-06-27 at 07 37 02

Applicable helpers:

  • Puppeteer
  • Playwright

Applicable plugins:

  • allure
  • screenshotOnFail

Type of change

  • 🐛 Bug fix

Checklist:

  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

Copy link
Contributor

@DavertMik DavertMik left a comment

Choose a reason for hiding this comment

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

This is so cool. Thank you!

@DavertMik DavertMik merged commit 3ae837b into 3.x Jul 1, 2023
8 checks passed
@kobenguyent kobenguyent deleted the feat/screenshot-for-all-sessions branch August 28, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants