From 37e7c528ae6c45194627e9164545ca88bdf28bc7 Mon Sep 17 00:00:00 2001 From: Andrea Fazzi Date: Mon, 10 Feb 2020 09:41:09 +0100 Subject: [PATCH] Working on school subscription regression test --- Makefile | 2 +- config/config.test.yaml | 2 +- dist/main.bundle.js | 4 +++- regression_test/regression_test.go | 12 +++++++++--- src/index.js | 2 ++ 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index fc40e602..72ce3bbc 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ test: docker-compose -f docker/oef_test/docker-compose.yaml down docker-compose -f docker/oef_test/docker-compose.yaml up -d db docker-compose -f docker/oef_test/docker-compose.yaml up -d smtp - go run -race main.go --config=docker/oef_test/config/config.yaml & + go run -race main.go --config=config/config.test.yaml & regression_test: go build . diff --git a/config/config.test.yaml b/config/config.test.yaml index ace39cc8..66b04386 100644 --- a/config/config.test.yaml +++ b/config/config.test.yaml @@ -10,7 +10,7 @@ handlers: allow_session_url_query: true orm: - connection: "oef:oef@tcp(localhost:3307)/oef_dev" + connection: "oef:oef@tcp(localhost:3307)/oef_test" options: "charset=utf8&parseTime=True&loc=Local" automigrate: true regenerate: false diff --git a/dist/main.bundle.js b/dist/main.bundle.js index 179246ef..de6f73de 100644 --- a/dist/main.bundle.js +++ b/dist/main.bundle.js @@ -99,8 +99,10 @@ $(function () { a = li[i]; //li[i].getElementsByTagName("a")[0]; if (a.innerHTML.toUpperCase().indexOf(filter) > -1) { li[i].style.display = ""; + li[i].classList.add("oef-selected-by-search"); } else { li[i].style.display = "none"; + li[i].classList.remove("oef-selected-by-search"); } } @@ -141,4 +143,4 @@ $(function () { /***/ }) /******/ ]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAgYTcxMGM3Y2ZkNTA0OTgyOGNjMmEiLCJ3ZWJwYWNrOi8vLy4vc3JjL2luZ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0aW9uLnJlcGxhY2UocmVzdWx0LnJlZGlyZWN0X3VybCk7XG5cdFx0fVxuXHQgICAgfSk7XG5cdCAgICBcblx0fSk7XG5cdFxuXHRyZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICBcbiAgICAkKFwiLmthcm1lbi1hamF4LWRlbGV0ZVwiKS5vbihcImNsaWNrXCIsIGRlbGV0ZUhhbmRsZXIpO1xuXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vc3JjL2luZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCIsIi8vIHJlbW92ZWQgYnkgZXh0cmFjdC10ZXh0LXdlYnBhY2stcGx1Z2luXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9zcmMvc3R5bGUuY3NzXG4vLyBtb2R1bGUgaWQgPSAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/regression_test/regression_test.go b/regression_test/regression_test.go index 45a55d38..947af66a 100644 --- a/regression_test/regression_test.go +++ b/regression_test/regression_test.go @@ -2,7 +2,6 @@ package regression_test import ( "fmt" - "log" "testing" "github.com/remogatto/prettytest" @@ -167,7 +166,6 @@ func (t *testSuite) TestSchoolSubscription() { } credentials := findElements("dd") - log.Println("DD", credentials) if len(credentials) == 0 { panic("Can't find credentials in the renderered HTML page") } @@ -197,7 +195,15 @@ func (t *testSuite) TestSchoolSubscription() { if err != nil { panic(err) } - err = findElement("a.list-group-item").Click() + err = findElement("a.oef-selected-by-search").Click() + if err != nil { + panic(err) + } + err = findElement("button.karmen-ajax-delete").Click() + if err != nil { + panic(err) + } + err = findElement("#karmen-modal-btn-confirm").Click() if err != nil { panic(err) } diff --git a/src/index.js b/src/index.js index b8d03c8d..2221618a 100644 --- a/src/index.js +++ b/src/index.js @@ -26,8 +26,10 @@ $(function () { a = li[i]; //li[i].getElementsByTagName("a")[0]; if (a.innerHTML.toUpperCase().indexOf(filter) > -1) { li[i].style.display = ""; + li[i].classList.add("oef-selected-by-search"); } else { li[i].style.display = "none"; + li[i].classList.remove("oef-selected-by-search"); } }