@webship-js/prestashop-steps 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webship-js/prestashop-steps",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Cucumber step definitions for testing PrestaShop shops with webship-js: the back office (session, menu, lists, products, categories, orders, customers, discounts, modules, permissions) and the shop (catalog, search, product page, cart, checkout, customer account, contact).",
5
5
  "main": "tests/step-definitions/prestashop.steps.js",
6
6
  "files": [
@@ -13,6 +13,11 @@ Feature: Modules of the shop
13
13
  Then I should see the module "Banner"
14
14
  But I should not see the module "Search bar"
15
15
 
16
+ Scenario: Search the installed modules for two words
17
+ When I search the modules for "Main menu"
18
+ Then I should see the module "Main menu"
19
+ But I should not see the module "Banner"
20
+
16
21
  @critical
17
22
  Scenario: Disable a module and enable it again
18
23
  Then the module "Banner" should be enabled
@@ -727,8 +727,8 @@ async function moduleCard(world, name) {
727
727
  }
728
728
 
729
729
  /**
730
- * Search the Module manager for a word: the list then shows only the cards
731
- * that match.
730
+ * Search the Module manager for a word or several words: the list then
731
+ * shows only the cards that match all of them.
732
732
  *
733
733
  * Example #1: When I search the modules for "Banner"
734
734
  * Example #2: When we search the modules for "Wire payment"
@@ -742,7 +742,11 @@ When(/^(I |we )*search the modules for "([^"]*)"$/, async function (pronounCase,
742
742
  await actOrExplain('search the modules for', word, async () => {
743
743
  await page.locator('.pstaggerAddTagInput:visible').first().fill(word, { timeout: budget(this) });
744
744
  await page.locator('#module-search-button').click();
745
- await page.locator('.pstaggerTag').filter({ hasText: literal(word) }).first().waitFor({ state: 'visible', timeout: budget(this) });
745
+ // The search box makes one tag of each word ("Main menu" becomes the
746
+ // tags "Main" and "menu"), so the search is in place when every word has its tag.
747
+ for (const part of word.trim().split(/\s+/).filter(Boolean)) {
748
+ await page.locator('.pstaggerTag').filter({ hasText: literal(part) }).first().waitFor({ state: 'visible', timeout: budget(this) });
749
+ }
746
750
  }, 'The search of the Module manager is the box at the top of Modules > Module Manager with the button #module-search-button; each search word becomes a tag.');
747
751
  });
748
752