Commit 8c115cd2 authored by David Hoksza's avatar David Hoksza
Browse files

test ready; ci

parent 3195cc7c
Pipeline #24841 canceled with stages
in 16 seconds
......@@ -9,7 +9,8 @@
"build-css": "node-sass --include-path src/css src/css/styles.scss src/css/styles.css",
"build": "mkdirp dist && npm run build-css && npm run babel && browserify -t browserify-css __tmp_minerva_plugin/js/index.js | uglifyjs --compress --mangle > dist/plugin.js && npm run clean-babel",
"build-debug": "mkdirp dist && npm run build-css && npm run babel && browserify -t browserify-css __tmp_minerva_plugin/js/index.js > dist/plugin.js && npm run clean-babel",
"clean": "rimraf dist && npm run clean-babel"
"clean": "rimraf dist && npm run clean-babel",
"test": "mocha tests"
},
"author": "David Hoksza",
"license": "MIT",
......@@ -23,7 +24,7 @@
"core-js": "^3.2.1",
"mkdirp": "^0.5.1",
"mocha": "^7.1.1",
"node-sass": "^4.6.1",
"node-sass": "latest",
"rimraf": "latest",
"selenium-webdriver": "^4.0.0-alpha.7",
"uglify-js": "^3.1.9",
......
const {Builder, By, until} = require('selenium-webdriver');
const {Builder, By, until, Key} = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const assert = require('chai').assert;
......@@ -103,8 +103,8 @@ describe("drug reactions plugin", async function() {
before(async function () {
const opts = new chrome.Options().addArguments('--no-sandbox', '--headless', '--remote-debugging-port=9222');
// driver = await new Builder().setChromeOptions(opts).forBrowser('chrome').build();
driver = await new Builder().forBrowser('chrome').build();
driver = await new Builder().setChromeOptions(opts).forBrowser('chrome').build();
// driver = await new Builder().forBrowser('chrome').build();
await driver.manage().window().maximize();
......@@ -129,11 +129,37 @@ describe("drug reactions plugin", async function() {
assert.equal(aracalyst.length, 2);
});
it("should highlight entities", function () {
it("should highlight entities", async function () {
const highlighted = await getHighlighted();
assert.isAbove(highlighted.length, 2);
});
describe("search", async function () {
let search;
before(async function () {
search = driver.findElement(By.css('.search input'));
await search.sendKeys("Arcalyst");
await search.sendKeys(Key.ENTER);
await wait(1000);
});
it("should filter and highlight", async function () {
let recs = await driver.findElements(By.css(".adr-table tbody tr"));
assert.equal(recs.length, 2);
const highlighted = await getHighlighted();
assert.equal(highlighted.length, 2);
await search.clear();
await wait(1000);
recs = await driver.findElements(By.css(".adr-table tbody tr"));
assert.isAbove(recs.length, 2);
})
});
after(async function finishWebDriver() {
// await driver.quit();
await driver.quit();
});
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment