-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/*! | ||
* Matomo - free/libre analytics platform | ||
* | ||
* Screenshot integration tests. | ||
* | ||
* @link https://matomo.org | ||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
*/ | ||
|
||
describe("EmptySite_React", function () { | ||
|
||
this.fixture = "Piwik\\Tests\\Fixtures\\EmptySite"; | ||
|
||
const generalParams = 'idSite=1&period=day&date=2010-01-03'; | ||
|
||
it('should show the tracking code if the website has no recorded data and React guide', async function () { | ||
|
||
testEnvironment.detectedContentDetections = ['ReactJs']; | ||
testEnvironment.connectedConsentManagers = []; | ||
testEnvironment.save(); | ||
|
||
const urlToTest = "?" + generalParams + "&module=CoreHome&action=index#?" + generalParams + '&activeTab=ReactJs'; | ||
await page.goto(urlToTest); | ||
await page.waitForSelector('#start-tracking-details .codeblock', {visible: true}); | ||
await page.evaluate(function () { | ||
// since containerID will be random and keeps changing | ||
var selector = $('#reactjs .codeblock'); | ||
selector.text(selector.text().replace(/http(.*)container_(.*).js/g, 'http://localhost/js/container_test123.js')); | ||
}); | ||
|
||
const pageElement = await page.$('.page'); | ||
expect(await pageElement.screenshot()).to.matchImage('emptySiteDashboard'); | ||
}); | ||
|
||
}); |
3 changes: 3 additions & 0 deletions
3
tests/UI/expected-screenshots/EmptySite_React_emptySiteDashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.