fix automatic test runner

This commit is contained in:
mdgriffith 2020-05-23 08:46:10 -04:00
parent d674a8d863
commit 7ed3ecb935
7 changed files with 67 additions and 63 deletions

50
package-lock.json generated
View File

@ -734,9 +734,9 @@
} }
}, },
"jszip": { "jszip": {
"version": "3.2.2", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.2.2.tgz", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.4.0.tgz",
"integrity": "sha512-NmKajvAFQpbg3taXQXr/ccS2wcucR1AZ+NtyWp2Nq7HHVsXhcJFR8p0Baf32C2yVvBylFWVeKf+WI2AnvlPhpA==", "integrity": "sha512-gZAOYuPl4EhPTXT0GjhI3o+ZAz3su6EhLrKUoAivcKqyqC7laS5JEv4XWZND9BgcDcF83vI85yGbDmDR6UhrIg==",
"requires": { "requires": {
"lie": "~3.3.0", "lie": "~3.3.0",
"pako": "~1.0.2", "pako": "~1.0.2",
@ -1002,20 +1002,24 @@
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
}, },
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"selenium-webdriver": { "selenium-webdriver": {
"version": "4.0.0-alpha.4", "version": "4.0.0-alpha.7",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.4.tgz", "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.7.tgz",
"integrity": "sha512-etJt20d8qInkxMAHIm5SEpPBSS+CdxVcybnxzSIB/GlWErb8pIWrArz/VA6VfUW0/6tIcokepXQ5ufvdzqqk1A==", "integrity": "sha512-D4qnTsyTr91jT8f7MfN+OwY0IlU5+5FmlO5xlgRUV6hDEV8JyYx2NerdTEqDDkNq7RZDYc4VoPALk8l578RBHw==",
"requires": { "requires": {
"jszip": "^3.1.5", "jszip": "^3.2.2",
"rimraf": "^2.6.3", "rimraf": "^2.7.1",
"tmp": "0.0.30", "tmp": "0.0.30"
"xml2js": "^0.4.19" },
"dependencies": {
"rimraf": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"requires": {
"glob": "^7.1.3"
}
}
} }
}, },
"semver": { "semver": {
@ -1217,22 +1221,6 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
}, },
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"requires": {
"sax": ">=0.6.0",
"xmlbuilder": "~9.0.1"
},
"dependencies": {
"xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
}
}
},
"xmlbuilder": { "xmlbuilder": {
"version": "13.0.2", "version": "13.0.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-13.0.2.tgz",

View File

@ -7,8 +7,8 @@
"test": "elm-test", "test": "elm-test",
"view-test": "node tests-rendering/automation/view.js", "view-test": "node tests-rendering/automation/view.js",
"test-render": "node tests-rendering/automation/run.js --chrome", "test-render": "node tests-rendering/automation/run.js --chrome",
"test-render-sauce": "source sauce.env; node tests-rendering/automation/run.js --sauce", "test-render-sauce": "source sauce.env; node tests-rendering/automation/run.js --sauce --headless",
"test-render-sauce-automated": "node tests-rendering/automation/run.js --sauce", "test-render-sauce-automated": "node tests-rendering/automation/run.js --sauce --headless",
"test-doc-preview": "bash tests-rendering/automation/doc-preview.sh", "test-doc-preview": "bash tests-rendering/automation/doc-preview.sh",
"bench": "node benchmarks/runtime/index.js", "bench": "node benchmarks/runtime/index.js",
"list-issues": "hub issue -f \"%i,%U,%t,'%L'%n\" > issues.csv" "list-issues": "hub issue -f \"%i,%U,%t,'%L'%n\" > issues.csv"
@ -29,6 +29,6 @@
"elm": "^0.19.1-3", "elm": "^0.19.1-3",
"elm-test": "^0.19.1-revision2", "elm-test": "^0.19.1-revision2",
"node-elm-compiler": "^5.0.4", "node-elm-compiler": "^5.0.4",
"selenium-webdriver": "^4.0.0-alpha.4" "selenium-webdriver": "^4.0.0-alpha.7"
} }
} }

View File

@ -17,6 +17,7 @@ program
.option("--build [value]", "Set build number for sauce labs") .option("--build [value]", "Set build number for sauce labs")
.option("--name [value]", "Set run name for sauce labs") .option("--name [value]", "Set run name for sauce labs")
.option("--verbose", "Print out all test results") .option("--verbose", "Print out all test results")
.option("--headless", "run tests without showing the browser")
.parse(process.argv); .parse(process.argv);
// 'Windows 10' // 'Windows 10'
@ -126,8 +127,13 @@ function prepare_sauce_driver(env) {
} }
async function prepare_local_driver(env) { async function prepare_local_driver(env) {
const firefoxOptions = new firefox.Options().headless(); const firefoxOptions = new firefox.Options();
const chromeOptions = new chrome.Options().headless(); const chromeOptions = new chrome.Options();
if (program.headless) {
firefoxOptions.headless();
chromeOptions.headless();
}
let driver = await new Builder() let driver = await new Builder()
.forBrowser(env.browser) .forBrowser(env.browser)
@ -163,7 +169,7 @@ async function run_test(driver, url) {
await compile_and_embed({ await compile_and_embed({
template: "./tests-rendering/automation/templates/gather-styles.html", template: "./tests-rendering/automation/templates/gather-styles.html",
target: "./tmp/test.html", target: "./tmp/test.html",
elm: "src/Tests/Run.elm", elm: "src/Tests/All.elm",
elmOptions: { cwd: "./tests-rendering" }, elmOptions: { cwd: "./tests-rendering" },
}); });
console.log("Done compiling"); console.log("Done compiling");

View File

@ -149,6 +149,9 @@
app.ports.report.subscribe(function (results) { app.ports.report.subscribe(function (results) {
test_results = results; test_results = results;
// NOTE - this is the signal to the automation that it is cool to retrieve results now
// So don't remove this like you did before :D
document.title = "tests finished";
}); });
app.ports.analyze.subscribe(function (ids) { app.ports.analyze.subscribe(function (ids) {

View File

@ -1,4 +1,4 @@
module SafariBugIssue147 exposing (view) module Layout.SafariBugIssue147 exposing (view)
{-| {-|

View File

@ -1,6 +1,6 @@
{ {
"type": "application", "type": "application",
"source-directories": ["src", "../src", "cases/open"], "source-directories": ["src", "../src", "cases/open", "cases/resolved"],
"elm-version": "0.19.1", "elm-version": "0.19.1",
"dependencies": { "dependencies": {
"direct": { "direct": {

View File

@ -5,8 +5,8 @@ module Tests.All exposing (main)
import ClippedElInFixedWidthColumn import ClippedElInFixedWidthColumn
import ElInFixedHeightColumn import ElInFixedHeightColumn
import InFrontSize import InFrontSize
import Layout.SafariBugIssue147
import NestedParagraphs import NestedParagraphs
import SafariBugIssue147
import StackedScrollingColumnsHeight import StackedScrollingColumnsHeight
import Testable.Generator import Testable.Generator
import Testable.Runner import Testable.Runner
@ -25,10 +25,14 @@ import WeirdCentering
main : Testable.Runner.TestableProgram main : Testable.Runner.TestableProgram
main = main =
(Testable.Runner.program << List.concat) (Testable.Runner.program << List.concat)
[ --Testable.Generator.element "Basics" [ Testable.Generator.element "Basics"
[]
-- , Testable.Generator.element "Align "
-- [] -- []
-- , Testable.Generator.element "Align " [] -- , [ Tuple.pair
-- Tuple.pair "Basic Element" Tests.Basic.view -- "Basic Element"
-- Tests.Basic.view
-- , Tuple.pair "Nearby" Tests.Nearby.view -- , Tuple.pair "Nearby" Tests.Nearby.view
-- , Tuple.pair "Element Alignment" Tests.ElementAlignment.view -- , Tuple.pair "Element Alignment" Tests.ElementAlignment.view
-- , Tuple.pair "Transparency" Tests.Transparency.view -- , Tuple.pair "Transparency" Tests.Transparency.view
@ -36,20 +40,23 @@ main =
-- -- This has 12k cases, so it runs slow and sometimes crashes IE -- -- This has 12k cases, so it runs slow and sometimes crashes IE
-- , Tuple.pair "Row Alignment" Tests.RowAlignment.view -- , Tuple.pair "Row Alignment" Tests.RowAlignment.view
-- , Tuple.pair "Column Spacing" Tests.ColumnSpacing.view -- , Tuple.pair "Column Spacing" Tests.ColumnSpacing.view
-- , Tuple.pair "Row Spacing" Tests.RowSpacing.view -- , Tuple.pair "Row Spacing"
-- [ Tuple.pair "Paragraph wrapping" Tests.TextWrapping.view -- Tests.RowSpacing.view
-- ] -- ]
-- , -- , [ Tuple.pair "Paragraph wrapping" Tests.TextWrapping.view
issues -- ]
-- , issues
] ]
issues = issues =
[ Testable.Runner.rename "Weird Centering" WeirdCentering.view [ -- Testable.Runner.rename "Weird Centering" WeirdCentering.view
, Testable.Runner.rename "Stacked scrolling columns height" StackedScrollingColumnsHeight.view -- , Testable.Runner.rename "Stacked scrolling columns height" StackedScrollingColumnsHeight.view
, Testable.Runner.rename "Safari bug issue147" SafariBugIssue147.view -- ,
, Testable.Runner.rename "Nested paragraphs" NestedParagraphs.view Testable.Runner.rename "Safari bug issue147" Layout.SafariBugIssue147.view
, Testable.Runner.rename "In front size" InFrontSize.view
, Testable.Runner.rename "El in fixed height column" ElInFixedHeightColumn.view -- , Testable.Runner.rename "Nested paragraphs" NestedParagraphs.view
, Testable.Runner.rename "Clipped el in fixed width column" ClippedElInFixedWidthColumn.view -- , Testable.Runner.rename "In front size" InFrontSize.view
-- , Testable.Runner.rename "El in fixed height column" ElInFixedHeightColumn.view
-- , Testable.Runner.rename "Clipped el in fixed width column" ClippedElInFixedWidthColumn.view
] ]