Skip to content

feat: add switchToTab#5436

Open
gimler wants to merge 1 commit intocodeceptjs:3.xfrom
gimler:feature/switchToTab
Open

feat: add switchToTab#5436
gimler wants to merge 1 commit intocodeceptjs:3.xfrom
gimler:feature/switchToTab

Conversation

@gimler
Copy link

@gimler gimler commented Feb 6, 2026

Add method to switch to tab

Our app open a window and in this window we call window.close() after clicking on button.

The problem is that switchToPreviousTab() need a active tab. In our app the window/tab is already close by our application.

So with the new method switchToTab you can switch to any open tab.

Applicable helpers:

  • Playwright
  • Puppeteer
  • WebDriver
  • REST
  • FileHelper
  • Appium
  • TestCafe

Applicable plugins:

  • allure
  • autoDelay
  • autoLogin
  • customLocator
  • pauseOnFail
  • coverage
  • retryFailedStep
  • screenshotOnFail
  • selenoid
  • stepByStepReport
  • stepTimeout
  • wdio
  • subtitles

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

Question

switchToNextTab also call await targetCreatedHandler.call(this, page) but switchToPreviousTab not. I am not shure if switchToTab should also call await targetCreatedHandler.call(this, page)?

We can also remove the duplicate code and use switchTotTab in switchToPreviousTab() and switchToNextTab()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant