Skip to content

fix: test for Google Analytics message - cli#3536 #114

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

Merged
merged 3 commits into from
Jun 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/build/common/usage_reporting_tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test for usage-reporting command
"""
import os

from core.base_class.BaseClass import BaseClass
from core.settings.strings import *
Expand All @@ -21,13 +22,29 @@ def test_001_usage_reporting_enable(self):
output = Tns.run_tns_command("usage-reporting enable")
assert enabled.format(usage_reporting, "now ") in output

# Check there is message for tracking in Google Analytics
output = Tns.run_tns_command("doctor", timeout=180, log_trace=True)
assert "Will send the following information to Google Analytics" in output

output = Tns.run_tns_command("usage-reporting status")
assert enabled.format(usage_reporting, "") in output

# https://github.com/NativeScript/nativescript-cli/issues/3595
output = Tns.create_app(self.app_name,
attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
log_trace=True,
force_clean=False, update_modules=True)
assert "label: 'data/apps/livesync-hello-world.tgz'" not in output
assert "label: 'localTemplate_tns-template-hello-world'" in output

def test_002_usage_reporting_disable(self):
output = Tns.run_tns_command("usage-reporting disable")
assert disabled.format(usage_reporting, "now ") in output

# Check there is no any message for tracking in Google Analytics
output = Tns.run_tns_command("doctor", timeout=180, log_trace=True)
assert "Will send the following information to Google Analytics" not in output

output = Tns.run_tns_command("usage-reporting status")
assert disabled.format(usage_reporting, "") in output

Expand Down