Skip to content

Commit

Permalink
Merge pull request DevExpress#16 from inikulin/master
Browse files Browse the repository at this point in the history
Restructure project. Move assets to the appropriate dirs.
  • Loading branch information
churkin committed Jul 13, 2015
2 parents 13cfc5d + 4143fce commit a659cea
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 70 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
node_js:
- iojs
- 0.10
- 0.12

notifications:
email: false
20 changes: 17 additions & 3 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
var gulp = require('gulp');
var babel = require('gulp-babel');
var less = require('gulp-less');
var eslint = require('gulp-eslint');
var del = require('del');
var mocha = require('gulp-mocha');
var del = require('del');
var merge = require('merge-stream');

gulp.task('clean', function (cb) {
del('lib', cb);
});

gulp.task('build', ['clean'], function () {
return gulp
var js = gulp
.src('src/**/*.js')
.pipe(babel())
.pipe(babel());

var styles = gulp
.src('src/**/*.less')
.pipe(less());

var templates = gulp
.src('src/**/*.mustache');

var images = gulp
.src('src/**/*.png');

return merge(js, styles, templates, images)
.pipe(gulp.dest('lib'));
});

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# testcafe-phoenix

[![Build Status](https://travis-ci.org/superroma/testcafe-phoenix.svg)](https://travis-ci.org/superroma/testcafe-phoenix)
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
{
"dependencies": {
"babel-runtime": "^5.6.15",
"callsite": "^1.0.0",
"mustache": "^2.1.2",
"promise": "^7.0.3",
"useragent": "^2.1.7"
},
"devDependencies": {
"babel-eslint": "^3.1.18",
"del": "^1.2.0",
"gulp": "^3.9.0",
"gulp-babel": "^5.1.0",
"gulp-eslint": "^0.15.0",
"gulp-mocha": "^2.1.2"
"gulp-less": "^3.0.3",
"gulp-mocha": "^2.1.2",
"merge-stream": "^0.1.8"
},
"dependencies": {
"babel-runtime": "^5.6.15",
"promise": "^7.0.3"
"scripts": {
"test": "gulp test"
}
}
2 changes: 1 addition & 1 deletion src/browser/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MESSAGES, getText } from '../messages';


// Const
const IDLE_PAGE_TEMPLATE = read('./idle-page/index.html.mustache');
const IDLE_PAGE_TEMPLATE = read('../client/browser-idle-page/index.html.mustache');


// Global instance counter used to generate ID's
Expand Down
4 changes: 2 additions & 2 deletions src/browser/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import read from '../utils/read-file-relative';


// Const
const IDLE_PAGE_SCRIPT = read('./idle-page/index.js');
const IDLE_PAGE_STYLE = read('./idle-page/styles.css');
const IDLE_PAGE_SCRIPT = read('../client/browser-idle-page/index.js');
const IDLE_PAGE_STYLE = read('../client/browser-idle-page/styles.css');


// Gateway
Expand Down
28 changes: 0 additions & 28 deletions src/browser/idle-page/.babelrc

This file was deleted.

7 changes: 0 additions & 7 deletions src/browser/idle-page/.eslintrc

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added src/client/core/index.js
Empty file.
Empty file.
Empty file.
Empty file added src/client/ui/index.js
Empty file.
Empty file added src/client/ui/styles.less
Empty file.
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Proxy } from './../../hammerhead/lib';
import { Proxy } from 'hammerhead';
import BrowserConnectionGateway from './browser/gateway';
import BrowserConnection from './browser/connection';
import Runner from './runner';
import read from './utils/read-file-relative';


// Const
const CORE_SCRIPT = read('../../_compiled_/testcafe_client/testcafe_core.js');
const UI_CORE_SCRIPT = read('../../_compiled_/testcafe_client/testcafe_ui_core.js');
const UI_STYLE = read('../../_compiled_/testcafe_client/styles.css');
const UI_SPRITE = read('../../_compiled_/testcafe_client/uisprite.png', true);
const CORE_SCRIPT = read('./client/core/index.js');
const UI_SCRIPT = read('./client/ui/index.js');
const UI_STYLE = read('./client/ui/styles.css');
const UI_SPRITE = read('./client/ui/sprite.png', true);


// TestCafe
Expand All @@ -23,9 +23,9 @@ export default class TestCafe {

_registerAssets () {
this.proxy.GET('/testcafe-core.js', { content: CORE_SCRIPT, contentType: 'application/x-javascript' });
this.proxy.GET('/testcafe-ui-core.js', { content: UI_CORE_SCRIPT, contentType: 'application/x-javascript' });
this.proxy.GET('/uistyle.css', { content: UI_STYLE, contentType: 'text/css' });
this.proxy.GET('/uisprite.png', { content: UI_SPRITE, contentType: 'image/png' });
this.proxy.GET('/testcafe-ui.js', { content: UI_SCRIPT, contentType: 'application/x-javascript' });
this.proxy.GET('/testcafe-ui-styles.css', { content: UI_STYLE, contentType: 'text/css' });
this.proxy.GET('/testcafe-ui-sprite.png', { content: UI_SPRITE, contentType: 'image/png' });
}


Expand Down
24 changes: 7 additions & 17 deletions src/runner/test-run/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Promise from 'promise';
import Mustache from 'mustache';
import { Session } from './../../../hammerhead/lib';
import { Session } from 'hammerhead';
import COMMANDS from './commands';
import UploadsStorage from '../../upload';
import read from '../utils/read-file-relative';
import read from '../../utils/read-file-relative';


// Const
const TEST_RUN_TEMPLATE = read('../../_compiled_/testcafe_client/test-run.js.mustache');
const IFRAME_TEST_RUN_TEMPLATE = read('../../_compiled_/testcafe_client/iframe-test-run.js.mustache');
const TEST_RUN_TEMPLATE = read('../../client/test-run/index.js.mustache');
const IFRAME_TEST_RUN_TEMPLATE = read('../../client/test-run/iframe.js.mustache');


export default class TestRun extends Session {
Expand Down Expand Up @@ -42,24 +40,16 @@ export default class TestRun extends Session {
this.injectable.styles.push('/uistyle.css');
}

async _loadUploads (paths) {
async _loadUploads () {
//TODO fix it after UploadStorage rewrite
return new Promise((resolve, reject)=> {
UploadsStorage.getFiles(paths, this.fixture.workingDir, (data, err) => {
if (err)
reject(err);
else
resolve(data);
});
});
}

_getPayloadScript () {
var requireJs = this.suite.requireJsMap[this.fixture.requireJsMapKey];
var sharedJs = requireJs + this.fixture.remainderJs;

// TODO
var nextStep = this.actionTargetWaiting ? this.nextStep - 1 : this.nextStep;
var nextStep = this.actionTargetWaiting ? this.nextStep - 1 : this.nextStep;

this.actionTargetWaiting = false;

Expand Down Expand Up @@ -163,7 +153,7 @@ ServiceMessages[COMMANDS.setTestError] = function (msg) {
};

ServiceMessages[COMMANDS.getAndUncheckFileDownloadingFlag] = function () {
var isFileDownloading = this.isFileDownloading;
var isFileDownloading = this.isFileDownloading;

this.isFileDownloading = false;

Expand Down
6 changes: 6 additions & 0 deletions test/server/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../.eslintrc",
"env": {
"mocha": true
}
}
17 changes: 17 additions & 0 deletions test/server/browser-connection-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
//var TestCafe = require('../../lib/');

// Test ready event
// Test heartbeat timeout
// Test idle page rendering
// Test status request

/*
describe('Browser connection', function () {
var testCafe = null;
before(function () {
testCafe = new TestCafe(1335, 1336);
});
after(function () {
testCafe.close();
});
});
*/

0 comments on commit a659cea

Please sign in to comment.