Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fix date.mob tests for chrome #2707

Benjamin Kinge3541540ce87
diff --git a/e2e/features/timeline/timeline-mobile-test.js b/e2e/features/timeline/timeline-mobile-test.js
index d49653d55..ca70f8030 100644
--- a/e2e/features/timeline/timeline-mobile-test.js
+++ b/e2e/features/timeline/timeline-mobile-test.js
@@ -10,24 +10,24 @@ module.exports = {
c.url(c.globals.url + '?now=2013-03-15T0');
c.resizeWindow(375, 667); // iPhone 6/7/8 dimensions
},
- 'Before 3:00 UTC: load yesterdays date': c => {
+ 'date.mob.init.2a: Before 3:00 UTC: load yesterdays date': c => {
c.waitForElementVisible(mobileDatePickerSelectBtn, TIME_LIMIT, e => {
c.assert.containsText(mobileDatePickerSelectBtn, '2013-03-14');
});
},
- 'Before 3:00 UTC: right button is not disabled': c => {
+ 'date.mob.init.2b: Before 3:00 UTC: right button is not disabled': c => {
c.expect.element(nextDayArrowContainer).to.be.present;
c.expect.element(nextDayArrowContainer + '.button-disabled').to.not.be.present;
c.click(nextDayArrowContainer);
c.waitForElementVisible(nextDayArrowContainer + '.button-disabled', TIME_LIMIT);
},
- 'After 3:00 UTC: load todays date': c => {
+ 'date.mob.init.3a: After 3:00 UTC: load todays date': c => {
c.url(c.globals.url + '?now=2013-03-15T4');
c.waitForElementVisible(mobileDatePickerSelectBtn, TIME_LIMIT, e => {
c.assert.containsText(mobileDatePickerSelectBtn, '2013-03-15');
});
},
- 'After 3:00 UTC: right button is disabled': c => {
+ 'date.mob.init.3b:After 3:00 UTC: right button is disabled': c => {
c.expect.element(nextDayArrowContainer).to.be.present;
c.expect.element(nextDayArrowContainer + '.button-disabled').to.be.present;
},
@@ -37,7 +37,7 @@ module.exports = {
c.assert.containsText(mobileDatePickerSelectBtn, '2013-03-15');
});
},
- 'mobile selector header should show 2013-03-15': c => {
+ 'date.mob.range.2: mobile selector header should show 2013-03-15': c => {
c.click(mobileDatePickerSelectBtn);
c.waitForElementVisible(datepickerHeader, TIME_LIMIT, e => {
c.assert.containsText(datepickerHeader, '2013-03-15');
@@ -52,8 +52,13 @@ module.exports = {
c.useCss();
c.assert.containsText(datepickerHeader, '2012-03-15');
},
- 'Date in header should be 2012-01-15 after month drag': c => {
- c.moveToElement('xpath', "//li[text()='01']", 10, 10)
+ 'date.mob.range.4: Date in header should be 2012-01-15 after month drag': c => {
+ c.moveToElement('xpath', "//li[text()='03']", 10, 10)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='04']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(1000)
+ .moveToElement('xpath', "//li[text()='02']", 10, 10)
.mouseButtonDown(0)
.moveToElement('xpath', "//li[text()='03']", 10, 10)
.mouseButtonUp(0);
@@ -61,16 +66,31 @@ module.exports = {
c.useCss();
c.assert.containsText(datepickerHeader, '2012-01-15');
},
- 'Date in header should be 2012-01-19 after day drag': c => {
- c.moveToElement('xpath', "//li[text()='17']", 2, 2)
+ 'date.mob.range.5: Date in header should be 2012-01-19 after day drag': c => {
+ c.moveToElement('xpath', "//li[text()='15']", 10, 10)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='14']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(1000)
+ .moveToElement('xpath', "//li[text()='16']", 10, 10)
.mouseButtonDown(0)
- .moveToElement('xpath', "//li[text()='13']", 10, 10)
+ .moveToElement('xpath', "//li[text()='15']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(1000)
+ .moveToElement('xpath', "//li[text()='17']", 10, 10)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='16']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(1000)
+ .moveToElement('xpath', "//li[text()='18']", 10, 10)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='17']", 10, 10)
.mouseButtonUp(0);
c.pause(1000);
c.useCss();
c.assert.containsText(datepickerHeader, '2012-01-19');
},
- 'Click okay button verify date has updated': c => {
+ 'date.mob.range.6: Click okay button verify date has updated': c => {
c.useXpath().click("//a[text()='OK']");
c.pause(1000);
c.useCss();
@@ -82,13 +102,13 @@ module.exports = {
c.assert.containsText(mobileDatePickerSelectBtn, '2013-07-20');
});
},
- 'mobile selector header should show 2013-07-20': c => {
+ 'date.mob.nav.2a: mobile selector header should show 2013-07-20': c => {
c.click(mobileDatePickerSelectBtn);
c.waitForElementVisible(datepickerHeader, TIME_LIMIT, e => {
c.assert.containsText(datepickerHeader, '2013-07-20');
});
},
- 'Year 2014 should be disabled and 2013 is not': c => {
+ 'date.mob.nav.2b: Year 2014 should be disabled and 2013 is not': c => {
c.waitForElementVisible(datepickerHeader, TIME_LIMIT, () => {
c.useXpath(); // https://github.com/nightwatchjs/nightwatch/issues/633#issuecomment-222968466
c.expect.element("//li[contains(@class, 'disabled') and text()='2014']").to.be.present;
@@ -96,15 +116,30 @@ module.exports = {
c.expect.element("//li[text()='2013']").to.be.present;
});
},
- 'Date in header should be 2013-02-20 after year drag': c => {
- c.moveToElement('xpath', "//li[text()='06']", 15, 15)
+ 'date.mob.nav.3: Date in header should be 2013-02-20 after year drag': c => {
+ c.moveToElement('xpath', "//li[text()='07']", 15, 15)
.mouseButtonDown(0)
- .moveToElement('xpath', "//li[text()='09']", 10, 10)
+ .moveToElement('xpath', "//li[text()='08']", 10, 10)
.mouseButtonUp(0)
- .pause(1000)
- .moveToElement('xpath', "//li[text()='03']", 15, 15)
+ .pause(500)
+ .moveToElement('xpath', "//li[text()='06']", 15, 15)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='07']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(500)
+ .moveToElement('xpath', "//li[text()='05']", 15, 15)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='06']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(500)
+ .moveToElement('xpath', "//li[text()='04']", 15, 15)
.mouseButtonDown(0)
.moveToElement('xpath', "//li[text()='05']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(500)
+ .moveToElement('xpath', "//li[text()='03']", 15, 15)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='04']", 10, 10)
.mouseButtonUp(0);
c.pause(1000);
c.useCss();
@@ -119,16 +154,21 @@ module.exports = {
c.useCss();
c.assert.containsText(datepickerHeader, '2014-02-20');
},
- 'Date in header should be 2013-12-20 after year drag': c => {
+ 'date.mob.nav.5: Date in header should be 2013-12-20 after year drag': c => {
c.moveToElement('xpath', "//li[text()='02']", 15, 15)
.mouseButtonDown(0)
- .moveToElement('xpath', "//li[text()='04']", 10, 10)
+ .moveToElement('xpath', "//li[text()='03']", 10, 10)
+ .mouseButtonUp(0)
+ .pause(500)
+ .moveToElement('xpath', "//li[text()='01']", 15, 15)
+ .mouseButtonDown(0)
+ .moveToElement('xpath', "//li[text()='02']", 10, 10)
.mouseButtonUp(0);
c.pause(1000);
c.useCss();
c.assert.containsText(datepickerHeader, '2013-12-20');
},
- 'Click okay button verify date has updated to 2013-12-20': c => {
+ 'date.mob.nav.6: Click okay button verify date has updated to 2013-12-20': c => {
c.useXpath().click("//a[text()='OK']");
c.pause(1000);
c.useCss();