Pete Freitag
My Company:
Builds security products & services for CFML developers.
Conference Sponsor!
Without CI
With CI
There are two basic functions.
component {
remote function add(x, y) {
return x+y;
}
}
services/calc.cfc
name: HelloCI
# The trigger
on:
push:
branches: [ hello ]
# The executable
jobs:
build:
runs-on: ubuntu-latest
steps:
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!
CFML Compiler |
Fixinator |
Postman/Newman |
---|---|---|
curl |
puppeteer |
cflint |
textlint |
codechecker |
TestBox |
jobs:
cfcompile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: cfcompile
uses: foundeo/cfml-compiler-action@master
with:
cfengine: lucee@5.2.9.31
jobs:
fixinator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fixinator Security Scan
uses: foundeo/fixinator-github-action@master
with:
fixinator_api_key: ${{ secrets.FIXINATOR_API_KEY }}
+
const puppeteer = require('puppeteer');
(async() => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('http://127.0.0.1:8855/', {waitUntil: 'load'});
await page.type('#x', '5');
await page.type('#y', '3');
await page.click('#addButton');
setTimeout(async()=> {
const answer = await page.$eval('#z', el => { return el.value } );
await page.screenshot({path: 'screenshot.png'});
if (answer == "8") {
console.log("Value Was 8");
await browser.close();
process.exit(0);
} else {
console.log("Value was not 8, it was: " + answer);
await browser.close();
process.exit(1);
}
}, 200);
})();
component extends="testbox.system.BaseSpec" {
function run(testResults, testBox) {
describe("Test Addition", function() {
it("Should be able to add two positive integers", function() {
var calc = new services.calc();
expect(calc.add(5,3)).toBe(8);
});
});
}
}
TestBox CheatSheet: https://cfdocs.org/testbox
CFML Compiler |
Fixinator |
Postman/Newman |
---|---|---|
curl |
puppeteer |
cflint |
textlint |
codechecker |
TestBox |
Questions?