Skip to content

New: Setup selenium functional UI framework#158

Merged
pramodsum merged 15 commits intobox:masterfrom
pramodsum:func
Apr 12, 2018
Merged

New: Setup selenium functional UI framework#158
pramodsum merged 15 commits intobox:masterfrom
pramodsum:func

Conversation

@pramodsum
Copy link
Contributor

  • Set up express app to generate annotator tokens and test browsers
  • Update travis.yml w/ saucelabs config
  • Allowing concurrent testing w/ file ids in env variables

Sumedha Pramod added 2 commits April 2, 2018 14:52
- Set up express app to generate annotator tokens and test browsers
- Update travis.yml w/ saucelabs config
- Allowing concurrent testing w/ file ids in env variables
@boxcla
Copy link

boxcla commented Apr 2, 2018

Verified that @pramodsum has signed the CLA. Thanks for the pull request!

.travis.yml Outdated
- /^greenkeeper/.*$/
email: false
# recipients:
# - spramod@box.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to leave this commented section?

codecept.conf.js Outdated
const isLocalBuild = typeof SAUCE_USERNAME === 'undefined';

if (isLocalBuild) {
// // Config to test using the Chrome emulator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code?

helperObj.WebDriverIO = commonConfigObj;
} else {
// Common saucelab config
const sauceObj = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved to a higher level variable, or does it need to be created on each run of this code?

@@ -0,0 +1,47 @@
/* eslint-disable func-names */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK you can bundle all of your eslint-disables into one statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@pramodsum pramodsum changed the title New: Add functional UI tests New: Setup selenium functional UI framework Apr 11, 2018

// Set up SDK & client
const sdk = new BoxSDK({
clientID: 'l20yq2uyg3y8vl27rvw67m8s0ryo9mrz',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this an env var?

@@ -0,0 +1,32 @@
<!DOCTYPE html>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a pug file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we're setting up the preview expiring embed using an express app, it uses pug to pass in the variables rather than a straight html file

<meta charset="UTF-8">
link(rel="stylesheet" href='annotations.css')
script(src='annotations.js')
link(rel="stylesheet" href='https://cdn01.boxcdn.net/platform/preview/1.37.0/en-US/preview.css')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you planning on keeping this up to date?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Preview shouldn't affect annotations anymore, using an older version of preview shouldn't make a difference. The only reason I could see to update this regularly would be if there's drastic changes to how Preview and Annotations interact.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can make this an env variable just incase?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also will have to update this after your css class gets added into preview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the CSS change is in the annotations codebase so it shouldn't affect the preview version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right

@@ -149,6 +150,7 @@ class Annotator extends EventEmitter {
.then(() => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate any actual changes to the lib as a separate commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to this PR #167

"watch": "yarn install && BABEL_ENV=dev NODE_ENV=dev ./node_modules/.bin/webpack --watch --progress --colors --config build/webpack.config.js",
"test": "yarn install && NODE_ENV=test ./node_modules/.bin/karma start build/karma.conf.js",
"debug": "yarn install && NODE_ENV=test ./node_modules/.bin/karma start build/karma.conf.js --no-single-run --auto-watch",
"setup-travis": "cd functional-tests && yarn install && node app.js",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to point to the functional test folder as well? functional_tests/app.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it cd's into the functional test folder so it's fine

@@ -0,0 +1 @@
module.exports = actor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file needed?

codecept.conf.js Outdated
const commonConfigObj = {
browser: BROWSER_NAME,
url: 'http://localhost:8080',
smartWait: DEFAULT_WAIT_TIME,
Copy link
Contributor

@DanDeMicco DanDeMicco Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove smartWait. Jeremy and I found it to be buggy

- name: Android
if: type = cron
jobs:
include:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out Daniel's recent commit where he cleaned this up.

<meta charset="UTF-8">
link(rel="stylesheet" href='annotations.css')
script(src='annotations.js')
link(rel="stylesheet" href='https://cdn01.boxcdn.net/platform/preview/1.37.0/en-US/preview.css')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also will have to update this after your css class gets added into preview.

@pramodsum pramodsum merged commit db9a320 into box:master Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants