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

[Behat][API] Browsing channels using their default locales #13823

Conversation

coldic3
Copy link
Contributor

@coldic3 coldic3 commented Apr 5, 2022

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets
License MIT

@coldic3 coldic3 requested a review from a team as a code owner April 5, 2022 06:54
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from 70449fb to 8788d4c Compare April 5, 2022 06:57
@probot-autolabeler probot-autolabeler bot added Documentation Documentation related issues and PRs - requests, fixes, proposals. Maintenance CI configurations, READMEs, releases, etc. labels Apr 5, 2022
@coldic3 coldic3 changed the base branch from 1.10 to master April 5, 2022 06:57
@coldic3 coldic3 changed the title [Behat][API] Browsing channels using their default locales [WIP][Behat][API] Browsing channels using their default locales Apr 5, 2022
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from 8788d4c to 63a0f91 Compare April 5, 2022 12:55
@probot-autolabeler probot-autolabeler bot added Admin AdminBundle related issues and PRs. Shop ShopBundle related issues and PRs. labels Apr 5, 2022
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch 2 times, most recently from e3e96b8 to d0c42b1 Compare April 5, 2022 13:10
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from d0c42b1 to 182a228 Compare April 5, 2022 14:42
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from 182a228 to 7d7f97c Compare April 5, 2022 22:39
src/Sylius/Behat/Context/Transform/LocaleContext.php Outdated Show resolved Hide resolved
Comment on lines 19 to 20
And I should be able to shop using the "norweski (Norwegia)" locale
And I should not be able to shop using the "angielski (Stany Zjednoczone)" locale
Copy link
Member

Choose a reason for hiding this comment

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

These ones should also be in English to make steps consistent

Copy link
Contributor Author

@coldic3 coldic3 Apr 11, 2022

Choose a reason for hiding this comment

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

The tricky part here is that we have a non-polish locale with polish translation. So then I would have to do something like :localNameInPolishLocale 🤔

Is :localNameInPolishLocale ok in your opinion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did :localeNameInCurrentLocale so :localeNameInItsLocale is now redundant 🙂

src/Sylius/Behat/Context/Api/Shop/LocaleContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Transform/LocaleContext.php Outdated Show resolved Hide resolved
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch 2 times, most recently from c74f091 to 2b45a65 Compare April 11, 2022 11:05
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from 2b45a65 to ae9d8d6 Compare April 11, 2022 11:28
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from 18d5d9f to 64f290d Compare April 11, 2022 22:40
@coldic3 coldic3 force-pushed the scenario/browsing-channels-using-their-default-locales branch from 64f290d to a086141 Compare April 11, 2022 22:56
@@ -75,6 +75,9 @@ public function iCreateNewChannel(string $channelName): void
*/
public function iVisitChannelHomepage(ChannelInterface $channel): void
{
$this->sharedStorage->set('hostname', $channel->getHostname());
$this->sharedStorage->set('locale', $channel->getDefaultLocale());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$this->sharedStorage->set('locale', $channel->getDefaultLocale());
$this->sharedStorage->set('current_locale', $channel->getDefaultLocale());

?

Comment on lines +18 to +19
- sylius.behat.context.api.shop.channel
- sylius.behat.context.api.shop.cart
Copy link
Member

Choose a reason for hiding this comment

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

It can be in alphabetical order

@coldic3 coldic3 changed the title [WIP][Behat][API] Browsing channels using their default locales [Behat][API] Browsing channels using their default locales Apr 12, 2022
@GSadee GSadee merged commit 7fb5d98 into Sylius:master Apr 12, 2022
@GSadee
Copy link
Member

GSadee commented Apr 12, 2022

Thanks, Kevin! 🥇

@coldic3 coldic3 deleted the scenario/browsing-channels-using-their-default-locales branch April 12, 2022 07:33
AdamKasp added a commit that referenced this pull request Apr 13, 2022
…nd handling multiple locales (GSadee)

This PR was merged into the 1.12-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | after #13708, similar to #13823
| License         | MIT

<!--
 - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

d6bd175 [Behat] Add possibility for removing key from shared storage
dfb008e [API][Shop][Behat] Implement scenarios for switching and handling multiple locales
b6f2ce5 [API][Shop][Behat] Implement scenarios for browsing products in different than default locale
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin AdminBundle related issues and PRs. Documentation Documentation related issues and PRs - requests, fixes, proposals. Maintenance CI configurations, READMEs, releases, etc. Shop ShopBundle related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants