4
4
import os
5
5
6
6
from core .base_class .BaseClass import BaseClass
7
+ from core .osutils .file import File
8
+ from core .settings .settings import TEST_RUN_HOME
7
9
from core .settings .strings import *
8
10
from core .tns .tns import Tns
9
11
10
12
11
13
class UsageReportingTests (BaseClass ):
14
+ config = os .path .join (TEST_RUN_HOME , 'node_modules' , 'nativescript' , 'config' , 'config.json' )
12
15
13
16
@classmethod
14
17
def setUpClass (cls ):
@@ -21,6 +24,8 @@ def tearDownClass(cls):
21
24
def test_001_usage_reporting_enable (self ):
22
25
output = Tns .run_tns_command ("usage-reporting enable" )
23
26
assert enabled .format (usage_reporting , "now " ) in output
27
+ assert "GA_TRACKING_ID" in File .read (self .config )
28
+ assert "UA-111455-44" in File .read (self .config )
24
29
25
30
# Check there is message for tracking in Google Analytics
26
31
output = Tns .run_tns_command ("doctor" , timeout = 180 , log_trace = True )
@@ -40,6 +45,8 @@ def test_001_usage_reporting_enable(self):
40
45
def test_002_usage_reporting_disable (self ):
41
46
output = Tns .run_tns_command ("usage-reporting disable" )
42
47
assert disabled .format (usage_reporting , "now " ) in output
48
+ assert "GA_TRACKING_ID" in File .read (self .config )
49
+ assert "UA-111455-44" in File .read (self .config )
43
50
44
51
# Check there is no any message for tracking in Google Analytics
45
52
output = Tns .run_tns_command ("doctor" , timeout = 180 , log_trace = True )
0 commit comments