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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cli init translation use correct actor instead of I #3848

Merged
merged 3 commits into from Sep 15, 2023

Conversation

andonary
Copy link
Contributor

@andonary andonary commented Sep 2, 2023

Motivation/Description of the PR

I wanted to generate a new project with codeceptjs with french's locale (i.e. use Je.suisSurLaPage('...')) instead of I.amOnPage('...')).
So I type on a blank project npx codeceptjs init and selected french translation. Then create new simple test and immediatly run the project with npx codeceptjs run.

But I got:

Object of type Je is not defined in container

Fixed this by replacing actor on codecept.conf.js:

  include: {
    Je: './steps_file.js'
  }

-This PR fix this issue by setting the correct basic's actor I with the one write in translation.
-This also improves an existing test test/runner/init_test.js

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
  • 馃搵 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)


actor = {
[nameOfActor]: stepFile,
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we have a break here to exit the loop?

@andonary
Copy link
Contributor Author

andonary commented Sep 2, 2023

I honnestly do not find why unit tests on CI fails. I tried on differents device (macOS, linux) with node16 and it always succeed...

@andonary
Copy link
Contributor Author

andonary commented Sep 2, 2023

well, it passes now. no clue

@DavertMik
Copy link
Contributor

Thanks, this init_test is just glorious!

@DavertMik DavertMik merged commit 2bf4d37 into codeceptjs:3.x Sep 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants