mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Test client using real browsers on Travis
no issue - drop phantomjs tests both locally and on Travis - instruct Travis to install latest Chrome and Firefox - start an X server when running the client tests on Travis - update testem config to start Chrome and Firefox in both local and CI tests - fix testing preview sizing in Firefox as it doesn't support `zoom: 50%` style - improve infinite scroll testing to be more reliable - fix post acceptance test to handle both mobile and desktop views
This commit is contained in:
parent
308bf1731f
commit
781bcaf276
4 changed files with 23 additions and 10 deletions
|
@ -3,10 +3,11 @@
|
||||||
"test_page": "tests/index.html?hidepassed",
|
"test_page": "tests/index.html?hidepassed",
|
||||||
"disable_watching": true,
|
"disable_watching": true,
|
||||||
"launch_in_ci": [
|
"launch_in_ci": [
|
||||||
"PhantomJS"
|
"Chrome",
|
||||||
|
"Firefox"
|
||||||
],
|
],
|
||||||
"launch_in_dev": [
|
"launch_in_dev": [
|
||||||
"PhantomJS",
|
"Chrome",
|
||||||
"Chrome"
|
"Firefox"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,12 +41,13 @@ describe('Acceptance: Posts - Post', function() {
|
||||||
visit('/');
|
visit('/');
|
||||||
|
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
// it redirects to first post
|
|
||||||
expect(currentURL(), 'currentURL').to.equal(`/${posts[0].id}`);
|
|
||||||
|
|
||||||
expect(find('.posts-list li').first().hasClass('active'), 'highlights latest post').to.be.true;
|
|
||||||
|
|
||||||
expect(find('.posts-list li').length, 'post list count').to.equal(3);
|
expect(find('.posts-list li').length, 'post list count').to.equal(3);
|
||||||
|
|
||||||
|
// if we're in "desktop" size, we should redirect and highlight
|
||||||
|
if (find('.content-preview:visible').length) {
|
||||||
|
expect(currentURL(), 'currentURL').to.equal(`/${posts[0].id}`);
|
||||||
|
expect(find('.posts-list li').first().hasClass('active'), 'highlights latest post').to.be.true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -267,7 +267,9 @@ describe('Acceptance: Settings - Tags', function () {
|
||||||
find('.tag-list').scrollTop(find('.tag-list-content').height());
|
find('.tag-list').scrollTop(find('.tag-list-content').height());
|
||||||
});
|
});
|
||||||
|
|
||||||
wait().then(() => {
|
triggerEvent('.tag-list', 'scroll');
|
||||||
|
|
||||||
|
andThen(() => {
|
||||||
// it loads the second page
|
// it loads the second page
|
||||||
expect(find('.settings-tags .settings-tag').length, 'tag list count on second load')
|
expect(find('.settings-tags .settings-tag').length, 'tag list count on second load')
|
||||||
.to.equal(30);
|
.to.equal(30);
|
||||||
|
@ -275,7 +277,9 @@ describe('Acceptance: Settings - Tags', function () {
|
||||||
find('.tag-list').scrollTop(find('.tag-list-content').height());
|
find('.tag-list').scrollTop(find('.tag-list-content').height());
|
||||||
});
|
});
|
||||||
|
|
||||||
wait().then(() => {
|
triggerEvent('.tag-list', 'scroll');
|
||||||
|
|
||||||
|
andThen(() => {
|
||||||
// it loads the final page
|
// it loads the final page
|
||||||
expect(find('.settings-tags .settings-tag').length, 'tag list count on third load')
|
expect(find('.settings-tags .settings-tag').length, 'tag list count on third load')
|
||||||
.to.equal(32);
|
.to.equal(32);
|
||||||
|
|
|
@ -33,6 +33,13 @@
|
||||||
#ember-testing > div {
|
#ember-testing > div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
/* fix firefox not supporting `zoom: 50%` */
|
||||||
|
_::-moz-range-track, body:last-child #ember-testing {
|
||||||
|
-moz-transform-origin: 0 0;
|
||||||
|
-moz-transform: scale(0.5);
|
||||||
|
width: 200%;
|
||||||
|
height: 200%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
Loading…
Add table
Reference in a new issue