Skip to content

Commit a2e9c6e

Browse files
author
OpenShift Bot
authored
Merge pull request #1057 from benjaminapetersen/run-on-e2e-setup
Merged by openshift-bot
2 parents e202d9f + 0c4ca98 commit a2e9c6e

25 files changed

+1057
-49
lines changed

test/.jshintrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"node": true,
33
"browser": true,
4-
"esnext": true,
4+
"esversion": 6,
55
"bitwise": true,
66
"camelcase": false,
77
"curly": true,
@@ -18,7 +18,9 @@
1818
"sub" : true,
1919
"undef": true,
2020
"unused": true,
21+
"expr" : true,
2122
"globals": {
23+
"ace": false,
2224
"after": false,
2325
"afterEach": false,
2426
"afterAll": false,
@@ -32,6 +34,7 @@
3234
"expect": false,
3335
"inject": false,
3436
"it": false,
37+
"xit": false,
3538
"jasmine": false,
3639
"spyOn": false,
3740
"hawtioPluginLoader": false,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
'use strict';
2+
3+
require('jasmine-beforeall');
4+
var h = require('../helpers');
5+
var projectHelpers = require('../helpers/project');
6+
var OverviewPage = require('../page-objects/overview').OverviewPage;
7+
var CreateProjectPage = require('../page-objects/createProject').CreateProjectPage;
8+
var DeploymentsPage = require('../page-objects/deployments').DeploymentsPage;
9+
var ServicesPage = require('../page-objects/services').ServicesPage;
10+
var RoutesPage = require('../page-objects/routes').RoutesPage;
11+
var nodeMongoTemplate = require('../fixtures/nodejs-mongodb');
12+
//var logger = require('../helpers/logger');
13+
// TODO: use this to alter whitelist in the tests to support the create from url flow
14+
// var env = require('../helpers/env');
15+
16+
describe('User adds a template to a project', function() {
17+
18+
beforeEach(function() {
19+
h.commonSetup();
20+
h.login();
21+
projectHelpers.deleteAllProjects();
22+
});
23+
24+
afterEach(function() {
25+
h.commonTeardown();
26+
});
27+
28+
describe('after creating a new project', function() {
29+
describe('using the "Import YAML/JSON" tab', function() {
30+
it('should process and create the objects in the template', function() {
31+
var project = projectHelpers.projectDetails();
32+
var createProjectPage = new CreateProjectPage(project);
33+
createProjectPage.visit();
34+
createProjectPage.createProject();
35+
var overviewPage = new OverviewPage(project);
36+
overviewPage.visit();
37+
var catalogPage = overviewPage.clickAddToProject(); // implicit redirect to catalog page
38+
catalogPage
39+
.processTemplate(JSON.stringify(nodeMongoTemplate))
40+
.then(function(createFromTemplatePage) {
41+
createFromTemplatePage.clickCreate(); // implicit redirect to overview page
42+
// verify we have the 2 deployments in the template
43+
var deploymentsPage = new DeploymentsPage(project);
44+
deploymentsPage.visit();
45+
expect(element(by.cssContainingText('td', 'mongodb')).isPresent()).toBe(true);
46+
expect(element(by.cssContainingText('td', 'nodejs-mongodb-example')).isPresent()).toBe(true);
47+
// verify we have the two services in the template
48+
var servicesPage = new ServicesPage(project);
49+
servicesPage.visit();
50+
expect(element(by.cssContainingText('td', 'mongodb')).isPresent()).toBe(true);
51+
expect(element(by.cssContainingText('td', 'nodejs-mongodb-example')).isPresent()).toBe(true);
52+
// verify we have one route for the mongo app
53+
var routesPage = new RoutesPage(project);
54+
routesPage.visit();
55+
expect(element(by.cssContainingText('td', 'nodejs-mongodb-example')).isPresent()).toBe(true);
56+
});
57+
});
58+
59+
xit('should save the template in the project catalog', function() {
60+
// TODO: same flow as the above test, but use:
61+
// catalogPage.saveTemplate(tpl)
62+
// & assert that the template was added to the catalog in this project
63+
});
64+
});
65+
});
66+
});

0 commit comments

Comments
 (0)