-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Show the JS tracking code instead of the dashboard while no visit is tracked #7365
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b1b6009
#7087 Show the JS tracking code instead of the dashboard while no vis…
mnapoli 60562b8
#7087 Query optimization
mnapoli cf7f60d
#7087 Added test
mnapoli eee6bd1
Trying to fix test that pass locally but not on travis
mnapoli a17363d
Trying to fix test that pass locally but not on travis
mnapoli 554da97
Style update
mnapoli aac43da
Improved the text help
mnapoli a398c3c
Merge branch 'master' into no-data-welcome
mnapoli c9149e2
Added tests for the "empty site welcome"
mnapoli 2273967
Merge branch 'master' into no-data-welcome
mnapoli 193d9c6
Rename screenshot to fix the tests
mnapoli a997288
Simpler UI test
mnapoli 06f3a4f
Black h3
mnapoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends "dashboard.twig" %} | ||
|
||
{% block notification %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
{% include "@CoreHome/_siteSelectHeader.twig" %} | ||
|
||
<div class="site-without-data"> | ||
|
||
<h2>{{ 'SitesManager_SiteWithoutDataTitle'|translate }}</h2> | ||
|
||
<p> | ||
{{ 'SitesManager_SiteWithoutDataDescription'|translate }} | ||
{{ 'SitesManager_SiteWithoutDataSetupTracking'|translate('<a href="' ~ linkTo({ | ||
'module': 'CoreAdminHome', | ||
'action': 'trackingCodeGenerator', | ||
}) ~ '">', '</a>')|raw }} | ||
</p> | ||
|
||
{{ trackingHelp|raw }} | ||
|
||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/processed-ui-screenshots | ||
/screenshot-diffs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/*! | ||
* Piwik - free/libre analytics platform | ||
* | ||
* Screenshot integration tests. | ||
* | ||
* @link http://piwik.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
*/ | ||
|
||
describe("EmptySite", function () { | ||
this.timeout(0); | ||
|
||
var generalParams = 'idSite=4&period=day&date=2010-01-03'; | ||
|
||
before(function () { | ||
testEnvironment.pluginsToLoad = ['SitesManager']; | ||
testEnvironment.save(); | ||
}); | ||
|
||
it('should show the tracking code if the website has no recorded data', function (done) { | ||
var urlToTest = "?" + generalParams + "&module=CoreHome&action=index"; | ||
|
||
expect.screenshot('emptySiteDashboard').to.be.captureSelector('.site-without-data', function (page) { | ||
page.load(urlToTest); | ||
}, done); | ||
}); | ||
}); |
Binary file added
BIN
+101 KB
...tesManager/tests/UI/expected-ui-screenshots/SitesManager_emptySiteDashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diosmosis is it expected we have to manually load the actual plugin the test is written in? could we improve this to automatically load the plugin being tested (here the UI test is in the SitesManager plugin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, tests should be run as
./console tests:run-ui --plugin=SitesManager
for plugins. howeve, SitesManager is a core plugin, it should always be loaded.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah OK I will remove that line then, I just used the UI tests generator and that was added automatically.