-
Notifications
You must be signed in to change notification settings - Fork 232
Run on e2e setup, test add to project flow, prepwork for Run On OpenShift tests #1057
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
Merged
openshift-bot
merged 1 commit into
openshift:master
from
benjaminapetersen:run-on-e2e-setup
Jan 25, 2017
Merged
Changes from all commits
Commits
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 hidden or 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
66 changes: 66 additions & 0 deletions
66
test/integration/features/user_adds_template_to_project.spec.js
This file contains hidden or 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,66 @@ | ||
'use strict'; | ||
|
||
require('jasmine-beforeall'); | ||
var h = require('../helpers'); | ||
var projectHelpers = require('../helpers/project'); | ||
var OverviewPage = require('../page-objects/overview').OverviewPage; | ||
var CreateProjectPage = require('../page-objects/createProject').CreateProjectPage; | ||
var DeploymentsPage = require('../page-objects/deployments').DeploymentsPage; | ||
var ServicesPage = require('../page-objects/services').ServicesPage; | ||
var RoutesPage = require('../page-objects/routes').RoutesPage; | ||
var nodeMongoTemplate = require('../fixtures/nodejs-mongodb'); | ||
//var logger = require('../helpers/logger'); | ||
// TODO: use this to alter whitelist in the tests to support the create from url flow | ||
// var env = require('../helpers/env'); | ||
|
||
describe('User adds a template to a project', function() { | ||
|
||
beforeEach(function() { | ||
h.commonSetup(); | ||
h.login(); | ||
projectHelpers.deleteAllProjects(); | ||
}); | ||
|
||
afterEach(function() { | ||
h.commonTeardown(); | ||
}); | ||
|
||
describe('after creating a new project', function() { | ||
describe('using the "Import YAML/JSON" tab', function() { | ||
it('should process and create the objects in the template', function() { | ||
var project = projectHelpers.projectDetails(); | ||
var createProjectPage = new CreateProjectPage(project); | ||
createProjectPage.visit(); | ||
createProjectPage.createProject(); | ||
var overviewPage = new OverviewPage(project); | ||
overviewPage.visit(); | ||
var catalogPage = overviewPage.clickAddToProject(); // implicit redirect to catalog page | ||
catalogPage | ||
.processTemplate(JSON.stringify(nodeMongoTemplate)) | ||
.then(function(createFromTemplatePage) { | ||
createFromTemplatePage.clickCreate(); // implicit redirect to overview page | ||
// verify we have the 2 deployments in the template | ||
var deploymentsPage = new DeploymentsPage(project); | ||
deploymentsPage.visit(); | ||
expect(element(by.cssContainingText('td', 'mongodb')).isPresent()).toBe(true); | ||
expect(element(by.cssContainingText('td', 'nodejs-mongodb-example')).isPresent()).toBe(true); | ||
// verify we have the two services in the template | ||
var servicesPage = new ServicesPage(project); | ||
servicesPage.visit(); | ||
expect(element(by.cssContainingText('td', 'mongodb')).isPresent()).toBe(true); | ||
expect(element(by.cssContainingText('td', 'nodejs-mongodb-example')).isPresent()).toBe(true); | ||
// verify we have one route for the mongo app | ||
var routesPage = new RoutesPage(project); | ||
routesPage.visit(); | ||
expect(element(by.cssContainingText('td', 'nodejs-mongodb-example')).isPresent()).toBe(true); | ||
}); | ||
}); | ||
|
||
xit('should save the template in the project catalog', function() { | ||
// TODO: same flow as the above test, but use: | ||
// catalogPage.saveTemplate(tpl) | ||
// & assert that the template was added to the catalog in this project | ||
}); | ||
}); | ||
}); | ||
}); |
File renamed without changes.
Oops, something went wrong.
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.
I'm unclear why we're deleting all projects before every test. Will this delete everything I've created if I run the tests in my development environment?
It seems like the test that creates the project should delete it on tear down.
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.
It should, but if a test fails protractor dies. It doesn't cleanup (and delete the project). So this is needed to ensure you start clean slate every time, otherwise you have to manually login as e2e-user and delete them by hand.
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.
OK, so it only deletes e2e-user projects? I'd add a comment explaining.
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.
Will do.
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.
dont forget to add the comment here like @spadgett requested
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.
Got it, I'll add the comment in the
projectHelpers
file abovedeleteAllProjects
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.
Oh, actually I already did there: