File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed
app/code/Magento/CatalogRule
dev/tests/integration/testsuite/Magento/Bundle/Model/Product Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -895,4 +895,12 @@ public function getIdentities()
895
895
{
896
896
return ['price ' ];
897
897
}
898
+
899
+ /**
900
+ * Clear price rules cache.
901
+ */
902
+ public function clearPriceRulesData (): void
903
+ {
904
+ self ::$ _priceRulesData = [];
905
+ }
898
906
}
Original file line number Diff line number Diff line change 19
19
<group value =" mtf_migrated" />
20
20
</annotations >
21
21
<before >
22
- <!-- Login as Admin -->
23
- <actionGroup ref =" AdminLoginActionGroup" stepKey =" loginAsAdmin" />
24
-
25
22
<!-- Create category -->
26
23
<createData entity =" _defaultCategory" stepKey =" createCategory" />
27
24
33
30
34
31
<!-- Update all products to have custom options -->
35
32
<updateData createDataKey =" createProduct1" entity =" productWithFixedOptions" stepKey =" updateProductWithOptions1" />
36
- <magentoCron groups =" index" stepKey =" runCronIndex" />
33
+ <actionGroup ref =" CliIndexerReindexActionGroup" stepKey =" reindex" >
34
+ <argument name =" indices" value =" " />
35
+ </actionGroup >
36
+
37
+ <!-- Login as Admin -->
38
+ <actionGroup ref =" AdminLoginActionGroup" stepKey =" loginAsAdmin" />
37
39
</before >
38
40
<after >
39
41
<!-- Delete products and category -->
60
62
<actionGroup ref =" SelectNotLoggedInCustomerGroupActionGroup" stepKey =" selectNotLoggedInCustomerGroup" />
61
63
62
64
<!-- Save and apply the new catalog price rule -->
63
- <actionGroup ref =" AdminEnableCatalogPriceRuleActionGroup" stepKey =" saveAndApplyCatalogPriceRule" />
65
+ <conditionalClick selector =" {{AdminNewCatalogPriceRule.active}}" dependentSelector =" {{AdminNewCatalogPriceRule.activeIsEnabled}}" visible =" false" stepKey =" enableActiveBtn" />
66
+ <click selector =" {{AdminNewCatalogPriceRule.save}}" stepKey =" clickSave" />
67
+ <waitForPageLoad stepKey =" waitForSave" />
64
68
65
69
<!-- Navigate to category on store front -->
66
70
<amOnPage url =" {{StorefrontProductPage.url($createCategory.name$)}}" stepKey =" goToStorefrontCategoryPage" />
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ abstract class BundlePriceAbstract extends \PHPUnit\Framework\TestCase
30
30
*/
31
31
protected $ productCollectionFactory ;
32
32
33
+ /**
34
+ * @var \Magento\CatalogRule\Model\RuleFactory
35
+ */
36
+ private $ ruleFactory ;
37
+
33
38
protected function setUp (): void
34
39
{
35
40
$ this ->objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
@@ -43,6 +48,7 @@ protected function setUp(): void
43
48
true ,
44
49
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
45
50
);
51
+ $ this ->ruleFactory = $ this ->objectManager ->get (\Magento \CatalogRule \Model \RuleFactory::class);
46
52
}
47
53
48
54
/**
@@ -62,6 +68,8 @@ abstract public function getTestCases();
62
68
*/
63
69
protected function prepareFixture ($ strategyModifiers , $ productSku )
64
70
{
71
+ $ this ->ruleFactory ->create ()->clearPriceRulesData ();
72
+
65
73
$ bundleProduct = $ this ->productRepository ->get ($ productSku );
66
74
67
75
foreach ($ strategyModifiers as $ modifier ) {
You can’t perform that action at this time.
0 commit comments