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

[Admin][Province] Managing country with provinces #4689

Merged

Conversation

GSadee
Copy link
Member

@GSadee GSadee commented Apr 4, 2016

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

Based on #4499


@ui @javascript
Scenario: Adding province to existing country
Given I want to edit this country
Copy link
Member

Choose a reason for hiding this comment

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

Given I want to edit the country "United Kingdom"

Copy link
Member Author

Choose a reason for hiding this comment

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

Why cannot I use this country in this step?

Copy link
Member

Choose a reason for hiding this comment

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

Because regarding the scope of the scenario we do not know which country it is. Even though there is only one defined in the shop by that I am forcing the reader to go back and read the background.
IMHO using the country's name is a whole lot more readable and we are really taking care of it in the new Behats. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not agree, IMO this is readable to the same extent as using country's name. This feature is using in every scenarios only one country and writing this country is more natural for me than using in every step country's name.

Copy link
Member

Choose a reason for hiding this comment

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

Please have a look at for instance the already merged editing_tax_category.feature, editing_tax_rate.feature or editing_locale.feature. All of the use the convention I've suggested.
@pjedrzejewski @michalmarcinkowski ?

@CoderMaggie
Copy link
Member

You can tag the scenarios that are not yet implemented with a @todo tag instead of suites tags, they will be skipped in tests then. :)

I want to be able to edit a country and its provinces

Background:
Given I am logged in as an administrator
Copy link
Member

Choose a reason for hiding this comment

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

This steps should be swapped. I am logged in as an administrator should be always written as a last one.

@GSadee GSadee force-pushed the editing-country-with-provinces branch from 5281de3 to 727e2d8 Compare April 5, 2016 07:05
@@ -0,0 +1,26 @@
@addressing
Feature: Editing country with provinces
Copy link
Member

Choose a reason for hiding this comment

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

I think it is misleading to name it Editing country with provinces. IMHO it should something like Managing provinces of a country? Or if you are convinced, that it should be a part of editing it should be placed under editing_country.feature

@GSadee GSadee force-pushed the editing-country-with-provinces branch 4 times, most recently from 82090dd to 65c3b1f Compare April 5, 2016 13:54
@@ -60,6 +60,8 @@ before_script:
- app/console assets:install --env=test_cached --no-debug
- app/console assetic:dump --env=test_cached --no-debug

- npm install
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be executed in install section (just as Composer install).

Copy link
Contributor

Choose a reason for hiding this comment

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

Also node_modules should be able to be added to cached directories.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changes from #4499 on which this PR based on

@GSadee GSadee force-pushed the editing-country-with-provinces branch from 65c3b1f to 4bc9fa6 Compare April 6, 2016 10:34
@michalmarcinkowski michalmarcinkowski added Behat Issues and PRs aimed at improving Behat usage. Awaiting Review Admin AdminBundle related issues and PRs. labels Apr 6, 2016
<argument type="service" id="sylius.factory.country" container="symfony" />
<argument type="service" id="sylius.repository.country" container="symfony" />
<argument type="service" id="sylius.converter.country_name" container="symfony" />
<argument type="service" id="sylius.behat.shared_storage" container="symfony" />
<argument type="service" id="sylius.factory.province" container="symfony" />
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest to put factories together

@GSadee GSadee force-pushed the editing-country-with-provinces branch 2 times, most recently from ae54a99 to f836b9b Compare April 6, 2016 13:24
$this->countryIndexPage->isResourceOnPage(['code' => $country->getCode()]),
sprintf('Country %s should exist but it does not', $country->getCode())
$this->countryUpdatePage->isOpen(['id' => $country->getId()]),
sprintf('Country %s does not appear in the store.', $country->getCode())
Copy link
Contributor

Choose a reason for hiding this comment

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

What was wrong with previous implementation? We agreed to check existence on index page.

@GSadee GSadee force-pushed the editing-country-with-provinces branch 3 times, most recently from ce63581 to f426ded Compare April 13, 2016 14:09
@GSadee GSadee force-pushed the editing-country-with-provinces branch from f426ded to 8beb0e3 Compare April 13, 2016 14:27
@GSadee GSadee changed the title [Admin][Province] Editing country with provinces [Admin][Province] Managing country with provinces Apr 13, 2016
@michalmarcinkowski michalmarcinkowski merged commit f4c4ac9 into Sylius:master Apr 14, 2016
@michalmarcinkowski
Copy link
Contributor

Thanks Grzesiu! 👍

@GSadee GSadee deleted the editing-country-with-provinces branch September 22, 2017 08:31
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. Behat Issues and PRs aimed at improving Behat usage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants