-
Notifications
You must be signed in to change notification settings - Fork 1
Create tests GH Actions workflow to run tests #3
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
Changes from all commits
a670b24
085cb80
9876d04
e4b0c0b
0df3aa3
75e6140
48175df
db4b270
023e3f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Install dependencies (npm ci) | ||
run: npm ci | ||
working-directory: ./phone-store | ||
- name: Run unit tests (npm run test) | ||
run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI | ||
working-directory: ./phone-store | ||
e2e-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
NicMcPhee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Cache node modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Install dependencies (npm ci) | ||
run: npm ci | ||
working-directory: ./phone-store | ||
- name: Run e2e tests | ||
run: npm run e2eci | ||
working-directory: ./phone-store |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const config = require('./protractor.conf').config; | ||
|
||
config.capabilities = { | ||
browserName: 'chrome', | ||
chromeOptions: { | ||
args: ['--headless', '--no-sandbox'] | ||
} | ||
}; | ||
|
||
config.highlightDelay = undefined; | ||
|
||
config.seleniumServerJar = process.env.SELENIUM_JAR_PATH; | ||
config.chromeDriver = process.env.CHROMEWEBDRIVER + '/chromedriver'; | ||
|
||
exports.config = config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ exports.config = { | |
capabilities: { | ||
browserName: 'chrome' | ||
}, | ||
directConnect: true, | ||
directConnect: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why you changed this from the default. I can see why you might want to from what I've read on-line, but then I'm not sure why they have it set to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We set this and moved to going through selenium in lab 3, 4, and the iteration template so we could use the element highlighting built into protractor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is necessary to make the highlighting work? Would it run (appreciably) faster if we didn't have that? I'm not convinced that students use the highlighting much, especially once there are a lot of tests, although @kklamberty probably has differing opinions on that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's not needed then we could remove it and also possibly change back a lot of the custom stuff we did to allow for the highlighting but we would want to do a good amount of testing, especially on lab machines, to make sure it still works correctly with the more default setup. |
||
baseUrl: 'http://localhost:4200/', | ||
framework: 'jasmine', | ||
jasmineNodeOpts: { | ||
|
@@ -28,5 +28,7 @@ exports.config = { | |
project: require('path').join(__dirname, './tsconfig.json') | ||
}); | ||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); | ||
} | ||
}; | ||
}, | ||
useBlockingProxy: true, | ||
highlightDelay: 200 // How long it waits and highlights before interacting with an element | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.