diff options
Diffstat (limited to 'tests/UI/specs/PeriodSelector_spec.js')
-rw-r--r-- | tests/UI/specs/PeriodSelector_spec.js | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/UI/specs/PeriodSelector_spec.js b/tests/UI/specs/PeriodSelector_spec.js index 7668d27375..410c4026d7 100644 --- a/tests/UI/specs/PeriodSelector_spec.js +++ b/tests/UI/specs/PeriodSelector_spec.js @@ -13,12 +13,18 @@ describe("PeriodSelector", function () { var generalParams = 'idSite=1&period=day&date=2012-01-01'; var url = '?module=CoreHome&action=index&' + generalParams + '#?' + generalParams + '&category=General_Actions&subcategory=General_Pages'; + var selector = '#periodString,#periodString .dropdown'; + it("should load correctly", function (done) { - expect.screenshot("loaded").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("loaded").to.be.captureSelector(selector, function (page) { page.load(url); // disable broadcast.propagateNewPage & remove loading gif page.evaluate(function () { + piwikHelper.isAngularRenderingThePage = function () { + return false; + }; + broadcast.propagateNewPage = function () {}; $('#ajaxLoadingCalendar').remove(); }); @@ -26,19 +32,19 @@ describe("PeriodSelector", function () { }); it("should expand when clicked", function (done) { - expect.screenshot("expanded").to.be.captureSelector('#periodString', function (page) { - page.click('.periodSelector'); + expect.screenshot("expanded").to.be.captureSelector(selector, function (page) { + page.click('.periodSelector .title'); }, done); }); it("should select a date when a date is clicked in day-period mode", function (done) { - expect.screenshot("day_selected").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("day_selected").to.be.captureSelector(selector, function (page) { page.click('.period-date .ui-datepicker-calendar a:contains(12)'); }, done); }); it("should change the month displayed when a month is selected in the month dropdown", function (done) { - expect.screenshot("month_changed").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("month_changed").to.be.captureSelector(selector, function (page) { page.evaluate(function () { $('.ui-datepicker-month').val(1).trigger('change'); }); @@ -46,7 +52,7 @@ describe("PeriodSelector", function () { }); it("should change the year displayed when a year is selected in the year dropdown", function (done) { - expect.screenshot("year_changed").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("year_changed").to.be.captureSelector(selector, function (page) { page.evaluate(function () { $('.ui-datepicker-year').val(2013).trigger('change'); }); @@ -54,34 +60,34 @@ describe("PeriodSelector", function () { }); it("should change the date when a date is clicked in week-period mode", function (done) { - expect.screenshot("week_selected").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("week_selected").to.be.captureSelector(selector, function (page) { page.click('label[for=period_id_week]'); page.click('.period-date .ui-datepicker-calendar a:contains(13)'); }, done); }); it("should change the date when a date is clicked in month-period mode", function (done) { - expect.screenshot("month_selected").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("month_selected").to.be.captureSelector(selector, function (page) { page.click('label[for=period_id_month]'); page.click('.period-date .ui-datepicker-calendar a:contains(14)'); }, done); }); it("should change the date when a date is clicked in year-period mode", function (done) { - expect.screenshot("year_selected").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("year_selected").to.be.captureSelector(selector, function (page) { page.click('label[for=period_id_year]'); page.click('.period-date .ui-datepicker-calendar a:contains(15)'); }, done); }); it("should display the range picker when the range radio button is clicked", function (done) { - expect.screenshot("range_picker_displayed").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("range_picker_displayed").to.be.captureSelector(selector, function (page) { page.click('label[for=period_id_range]'); }, done); }); it("should change from & to dates when range picker calendar dates are clicked", function (done) { - expect.screenshot("date_range_selected").to.be.captureSelector('#periodString', function (page) { + expect.screenshot("date_range_selected").to.be.captureSelector(selector, function (page) { page.click('#calendarFrom .ui-datepicker-calendar a:contains(10)'); page.click('#calendarTo .ui-datepicker-calendar a:contains(18)'); page.mouseMove('#calendarApply'); |