File tree 2 files changed +34
-1
lines changed
Newsletter/Test/Mftf/Test
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 9
9
use Magento \Customer \Model \AccountManagement ;
10
10
use Magento \Framework \App \ObjectManager ;
11
11
use Magento \Newsletter \Model \Config ;
12
+ use Magento \Store \Model \ScopeInterface ;
12
13
13
14
/**
14
15
* Customer register form block
@@ -184,7 +185,7 @@ public function getRegion()
184
185
public function isNewsletterEnabled ()
185
186
{
186
187
return $ this ->_moduleManager ->isOutputEnabled ('Magento_Newsletter ' )
187
- && $ this ->newsLetterConfig ->isActive ();
188
+ && $ this ->newsLetterConfig ->isActive (ScopeInterface:: SCOPE_STORE );
188
189
}
189
190
190
191
/**
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+
9
+ <tests xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
10
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/testSchema.xsd" >
11
+ <test name =" StorefrontNewsletterSubscriptionDisabledForStoreViewAtRegistrationTest" >
12
+ <annotations >
13
+ <features value =" Newsletter" />
14
+ <stories value =" Disabled Newsletter Subscription for store View" />
15
+ <title value =" Disabled Newsletter Subscription for store View" />
16
+ <description value =" Option to subscribe should not be displayed at registration form if it is switched off for current store" />
17
+ <severity value =" AVERAGE" />
18
+ <group value =" newsletter" />
19
+ <group value =" configuration" />
20
+ <testCaseId value =" MC-*" />
21
+ </annotations >
22
+ <before >
23
+ <magentoCLI command =" config:set --scope=stores --scope-code=default newsletter/general/active 0" stepKey =" disableSubscriptionForStore" />
24
+ </before >
25
+ <after >
26
+ <magentoCLI command =" config:set --scope=stores --scope-code=default newsletter/general/active 1" stepKey =" enableSubscriptionForStore" />
27
+ </after >
28
+ <actionGroup ref =" StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey =" openCreateAccountPage" />
29
+ <waitForPageLoad stepKey =" waitForPageLoad" />
30
+ <dontSeeElement selector =" {{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey =" checkNoSubscriptionOption" />
31
+ </test >
32
+ </tests >
You can’t perform that action at this time.
0 commit comments