-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from topcoder-platform/dev
Promote to prod
- Loading branch information
Showing
11 changed files
with
303 additions
and
47 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"generator-gulp-angular": { | ||
"version": "1.0.0", | ||
"props": { | ||
"angularVersion": "~1.4.2", | ||
"angularModules": [ | ||
{ | ||
"key": "animate", | ||
"module": "ngAnimate" | ||
}, | ||
{ | ||
"key": "cookies", | ||
"module": "ngCookies" | ||
}, | ||
{ | ||
"key": "touch", | ||
"module": "ngTouch" | ||
}, | ||
{ | ||
"key": "sanitize", | ||
"module": "ngSanitize" | ||
}, | ||
{ | ||
"key": "messages", | ||
"module": "ngMessages" | ||
}, | ||
{ | ||
"key": "aria", | ||
"module": "ngAria" | ||
} | ||
], | ||
"jQuery": { | ||
"key": "jqLite" | ||
}, | ||
"resource": { | ||
"key": "$http", | ||
"module": null | ||
}, | ||
"router": { | ||
"key": "angular-route", | ||
"module": "ngRoute" | ||
}, | ||
"ui": { | ||
"key": "angular-material", | ||
"module": "ngMaterial" | ||
}, | ||
"cssPreprocessor": { | ||
"key": "node-sass", | ||
"extension": "scss" | ||
}, | ||
"jsPreprocessor": { | ||
"key": "noJsPrepro", | ||
"extension": "js", | ||
"srcExtension": "js" | ||
}, | ||
"htmlPreprocessor": { | ||
"key": "noHtmlPrepro", | ||
"extension": "html" | ||
}, | ||
"bootstrapComponents": { | ||
"name": null, | ||
"version": null, | ||
"key": null, | ||
"module": null | ||
}, | ||
"foundationComponents": { | ||
"name": null, | ||
"version": null, | ||
"key": null, | ||
"module": null | ||
}, | ||
"paths": { | ||
"src": "src", | ||
"dist": "dist", | ||
"e2e": "e2e", | ||
"tmp": ".tmp" | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,81 @@ | ||
# support-admin-app | ||
Support application <br> | ||
Support application | ||
|
||
Internal application used to administer specific support tasks related to the Topcoder platform. | ||
|
||
User Management | ||
Submission Management | ||
Tag Management | ||
## Software Requirements | ||
|
||
- node.js v6+ | ||
- npm v3+ | ||
- Google Chrome browser version >= 55.0.2883.0 | ||
|
||
## Installation | ||
|
||
To install npm and bower dependencies run: | ||
|
||
> npm install | ||
Bower is set to run as a npm postinstall script. | ||
|
||
## Configuration | ||
|
||
The configuration is provided in `config.json` in the base directory. | ||
It contains four environments (`local`, `dev`, `qa`, `prod`) which are controlled by the BUILD_ENV environment variable, | ||
it defaults to the `dev` environment if BUILD_ENV is empty. | ||
|
||
The following configuration parameters are available: | ||
|
||
| Name | Description | | ||
|--------------------------|---------------------------------| | ||
| ES_PROJECT_API_URL | URL of the ES project API | | ||
| API_URL | URL of the topcoder API | | ||
| WORK_API_URL | URL of the topcoder work API | | ||
| ADMIN_TOOL_URL | URL of the admin tool API | | ||
| API_VERSION_PATH | Version of the API | | ||
| AUTH0_CLIENT_ID | Client ID for Auth0 | | ||
| AUTH0_DOMAIN | Domain for Auth0 authentication | | ||
| AUTH0_TOKEN_NAME | Auth0 token name | | ||
| AUTH0_REFRESH_TOKEN_NAME | Auth0 refresh token name | | ||
|
||
## Start the Application | ||
|
||
Simply execute the following command to start the app in development mode (with browsersync) | ||
``` | ||
npm install | ||
npm start | ||
``` | ||
Application will be hosted and running at http://locahost:3000 | ||
|
||
To build the application to be hosted on a real webserver run: | ||
``` | ||
npm run build | ||
``` | ||
|
||
## Execute E2E Tests | ||
|
||
```npm test``` | ||
|
||
## Fallback instruction in case the npm scripts fail | ||
|
||
### Install global dependencies | ||
|
||
```npm install -g [email protected] bower``` | ||
|
||
### Install project dependencies | ||
|
||
``` | ||
npm install | ||
bower install | ||
``` | ||
|
||
### Start the Application | ||
|
||
```gulp serve``` | ||
|
||
### Build the Application | ||
|
||
```gulp build``` | ||
|
||
### Execute E2E Tests | ||
|
||
```gulp protractor``` |
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,24 @@ | ||
##Set Node Js Version (Could be set to needed version) | ||
machine: | ||
node: | ||
version: 6.8.1 | ||
|
||
# Add some environment variables | ||
environment: | ||
CIRCLE_ENV: dev | ||
|
||
## Customize dependencies | ||
dependencies: | ||
pre: | ||
- curl -s https://raw.githubusercontent.com/chronogolf/circleci-google-chrome/master/use_chrome_stable_version.sh | bash | ||
|
||
override: | ||
- npm install | ||
|
||
compile: | ||
override: | ||
- npm run build | ||
|
||
test: | ||
override: | ||
- npm run test |
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,22 @@ | ||
'use strict'; | ||
|
||
describe('The dashboard view', function () { | ||
var page; | ||
var mainPage; | ||
|
||
beforeEach(function () { | ||
browser.get('http://localhost:3000/'); | ||
page = require('./login.po'); | ||
mainPage = require('./main.po'); | ||
page.usernameInput.sendKeys('amy_admin'); | ||
page.passwordInput.sendKeys('topcoder1'); | ||
page.loginButton.click(); | ||
}); | ||
|
||
it('should find members', function() { | ||
mainPage.searchHandleInput.sendKeys('sah2ed'); | ||
mainPage.searchButton.click(); | ||
expect(mainPage.users.count()).toBe(1); | ||
expect(mainPage.users.get(0).element(by.cssContainingText('td', 'sah2ed')).getText()).toBe('sah2ed'); | ||
}); | ||
}); |
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,22 @@ | ||
/** | ||
* This file uses the Page Object pattern to define the main page for tests | ||
* https://docs.google.com/presentation/d/1B6manhG0zEXkC-H-tPo2vwU06JhL8w9-XCF9oehXzAQ | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var LoginPage = function() { | ||
/*this.jumbEl = element(by.css('.jumbotron')); | ||
this.h1El = this.jumbEl.element(by.css('h1')); | ||
this.imgEl = this.jumbEl.element(by.css('img')); | ||
this.thumbnailEls = element(by.css('body')).all(by.repeater('awesomeThing in awesomeThings'));*/ | ||
this.loginForm = element(by.css('form')); | ||
this.loginHeader = this.loginForm.element(by.css('h3')); | ||
const inputs = this.loginForm.all(by.css('input')); | ||
this.usernameInput = inputs.get(0); | ||
this.passwordInput = inputs.get(1); | ||
this.loginButton = this.loginForm.element(by.css('button')); | ||
this.alerts = element(by.css('body')).all(by.repeater('alert in alerts')); | ||
}; | ||
|
||
module.exports = new LoginPage(); |
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,48 @@ | ||
'use strict'; | ||
|
||
describe('The login view', function () { | ||
var page; | ||
var mainPage; | ||
|
||
beforeEach(function () { | ||
browser.get('http://localhost:3000/'); | ||
page = require('./login.po'); | ||
mainPage = require('./main.po'); | ||
}); | ||
|
||
it('should display the correct form heading', function() { | ||
expect(page.loginHeader.getText()).toBe('ADMIN APP LOGIN'); | ||
//expect(page.imgEl.getAttribute('src')).toMatch(/assets\/images\/yeoman.png$/); | ||
//expect(page.imgEl.getAttribute('alt')).toBe('I\'m Yeoman'); | ||
}); | ||
|
||
it('login should fail for wrong credentials', function () { | ||
//expect(page.thumbnailEls.count()).toBeGreaterThan(5); | ||
page.usernameInput.sendKeys('wrong'); | ||
page.passwordInput.sendKeys('wrong'); | ||
page.loginButton.click(); | ||
expect(page.alerts.count()).toBe(1); | ||
expect(page.alerts.get(0).getText()).toBe('Wrong username or password.'); | ||
}); | ||
|
||
it('login should succeed for correct credentials', function () { | ||
//expect(page.thumbnailEls.count()).toBeGreaterThan(5); | ||
page.usernameInput.sendKeys('amy_admin'); | ||
page.passwordInput.sendKeys('topcoder1'); | ||
page.loginButton.click(); | ||
expect(mainPage.isUserLoggedIn.isDisplayed()).toBeTruthy(); | ||
expect(mainPage.loggedInUser.getText()).toBe('amy_admin'); | ||
}); | ||
|
||
it('logout should work after login', function () { | ||
//expect(page.thumbnailEls.count()).toBeGreaterThan(5); | ||
page.usernameInput.sendKeys('amy_admin'); | ||
page.passwordInput.sendKeys('topcoder1'); | ||
page.loginButton.click(); | ||
expect(mainPage.isUserLoggedIn.isDisplayed()).toBeTruthy(); | ||
expect(mainPage.loggedInUser.getText()).toBe('amy_admin'); | ||
mainPage.logout.click(); | ||
expect(page.loginHeader.getText()).toBe('ADMIN APP LOGIN'); | ||
}); | ||
|
||
}); |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.