[OS-951, OS-971, OS-958] PoC Make Art chromium selenium web driver#433
[OS-951, OS-971, OS-958] PoC Make Art chromium selenium web driver#433lauraenria wants to merge 727 commits intomasterfrom
Conversation
…/make-art into japanese_translation
Virtual page tracking with GA
Changed icon background colour for Kano Apps
I18n support and Japanese translations
Adding rgb+rgba color functions for straightforward color creation
fix gotToPlayground function
implement drawFigure for playground
implement how long the canvas is going to take take data
add module getTime improved time testing add color to console.log
change findelement with elementLocated
automate all test through challenges
delete console.log add commentes try to fix Go back home menu end challenges
benchmark and path for challenges
EGLFS
tombettany
left a comment
There was a problem hiding this comment.
You should reorganise this a little to have something like:
...
tests/
auto/
testChallenges.js
...
benchmark/
launchBenchmarks.js
...
manual/
results/
chromium.md
webengine.md
...
utils/
navigation.js
...
Also, extract the Chromium PoC code, we can't merge in the selenium stuff with it.
selenium-webdriver/getTime.js
Outdated
| module.exports = { | ||
| start : (el) => { | ||
| startTime = process.hrtime(); | ||
| console.log(`startTime ${el} =>`.green, `${startTime[0]} s ${startTime[1]} ns`.yellow) |
There was a problem hiding this comment.
Console log slows down the running of the code and interferes with the benchmark. We don't really care what time it started, we only really care about how long it takes which is printed in the end() function. If you want to log when we start timing then simply move this above the process.hrtime() and change the message to be a generic "Timer started" or something.
selenium-webdriver/mainSetup.js
Outdated
|
|
||
| module.exports = { | ||
| myServer: myServer, | ||
| main: main |
There was a problem hiding this comment.
Not really the main, maybe export this as driver or something that lets us know that this is actually the driver.
There was a problem hiding this comment.
I changed it as driver.
selenium-webdriver/mainSetup.js
Outdated
| @@ -0,0 +1,20 @@ | |||
| const { Builder } = require('selenium-webdriver'); | |||
|
|
|||
| let myServer = 'http://172.16.254.110:3000' | |||
There was a problem hiding this comment.
Hard-coded IP address. Either change this to http://127.0.0.1:3000 which will always point to the computer that you are on or don't set it and have it read from a configuration file.
There was a problem hiding this comment.
I am going to use http://127.0.0.1:3000 and probably give a look from a config file.
selenium-webdriver/mainSetup.js
Outdated
| let myServer = 'http://172.16.254.110:3000' | ||
| const chrome = require('selenium-webdriver/chrome') | ||
| const chrome_options = new chrome.Options(); // you will need to setup Chroumium | ||
| chrome_options.setChromeBinaryPath('/usr/bin/chromium-browser'); |
There was a problem hiding this comment.
Right now this is only for Chromium but it might be nice in the future to have the user able to choose which browser they wish to use when the run the tests.
selenium-webdriver/mainSetup.js
Outdated
| .setChromeOptions(chrome_options) | ||
|
|
||
| const driver_chr = driver_builder.build(); | ||
| return driver_chr; |
There was a problem hiding this comment.
Could just
return driver_builder.build();There was a problem hiding this comment.
this was because initially there was even a Firefox option
let driver_fx = new webdriver.Builder() .forBrowser('firefox') .build();
| for (let i = maxNumber; i >= 10; i = i - 10) { | ||
| maxNumber = i | ||
| let col = randomColor(colorsArray) | ||
| resultDraw = `color ${col}\n${figure} ${maxNumber}` |
There was a problem hiding this comment.
Huh?
Are we simply trying to count down from 200 in 10s? If so, this whole maxNumber bit is unnecessary:
for (let i = maxNumber; i >= 10; i -= 10) {
let col = randomColor(colorsArray)
resultDraw = `color ${col}\n${figure} ${i}`
array.push(resultDraw)
}
README.md
Outdated
|
|
||
| Follow this [Setting up your own test automation environment](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Your_own_automation_environment) | ||
|
|
||
| - run `npm install selenium-webdriver` inside your local repo |
There was a problem hiding this comment.
Shouldn't be needed - npm install should grab it as it is a dependency.
There was a problem hiding this comment.
ok, i modified the text
| ]; | ||
|
|
||
| function randomColor(colorsArray) { | ||
| return colorsArray[Math.floor(colorsArray.length * Math.random())] |
There was a problem hiding this comment.
Looks like 2 space indents have been used for all this code, make it 4 to match the rest of the codebase.
|
|
||
| function drawFigure(colorsArray = colors, figure = 'circle') { | ||
| let maxNumber = 200; | ||
| let resultDraw = '' |
There was a problem hiding this comment.
Inconsistency ending lines with ; and not bothering, choose one and stick with it.
kano_draw/draw.py
Outdated
| url = base_url.format(path='') | ||
|
|
||
| self._index = url | ||
| self._index = 'chromium --app={url} --start-fullscreen'.format(url=url) |
There was a problem hiding this comment.
Split this out of this PR, we can't merge the tests and benchmarks in with this bit. It could be that you've pulled a commit from your other branch.
function and filename
add jshint 9 and semicolon, add "use strict" delete default Chromium setup
add chromium and Qtwebengine data
with Chromium
Use Selenium web driver to test the poc make art in chromium