Skip to content

Commit a4a502d

Browse files
author
Dimitar Todorov
committed
Fix: skip last 2 tests for non angular projecs - issue in appium and android.
1 parent 5eb9cd5 commit a4a502d

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

tests/e2e/tests.e2e.ts

+34-32
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe("DateTimePicker", () => {
144144
const dateString = day + "." + monthString + "." + year;
145145
console.log(dateString);
146146
const dateField = await driver.findElementByText(dateString);
147-
expect(dateString).to.exist;
147+
expect(dateField).to.exist;
148148
});
149149

150150
it("Should scroll to custom format and verify values", async () => {
@@ -283,36 +283,38 @@ describe("DateTimePicker", () => {
283283
await customButtonsTitle.click();
284284
});
285285

286-
it("Should tap button to select date and verify button text", async () => {
287-
await scrollToElement(driver, "tap to select date and time", Direction.down);
288-
let dateButton = await driver.findElementByText("tap to select date", SearchOptions.contains);
289-
await dateButton.click();
290-
const date = await getPickerDate(driver);
291-
await clickOkBtn(driver);
292-
const pickerDate = new Date(date);
293-
let day = pickerDate.getDate();
294-
let dayString = day.toString();
295-
if(day < 10){
296-
dayString = "0" + day.toString();
297-
}
298-
let month = pickerDate.getMonth() + 1;
299-
let monthString = month.toString();
300-
if(month < 10){
301-
monthString = "0" + month.toString();
302-
}
303-
let year = pickerDate.getFullYear();
304-
const dateString = dayString + "." + monthString+ "." + year;
305-
console.log(dateString);
306-
const dateField = await driver.findElementByText(dateString);
307-
expect(dateString).to.exist;
308-
})
286+
if (process.env["Type"] === 'Angular'){
287+
it("Should tap button to select date and verify button text", async () => {
288+
await scrollToElement(driver, "tap to select date and time", Direction.down);
289+
let dateButton = await driver.findElementByText("tap to select date", SearchOptions.contains);
290+
await dateButton.click();
291+
const date = await getPickerDate(driver);
292+
await clickOkBtn(driver);
293+
const pickerDate = new Date(date);
294+
let day = pickerDate.getDate();
295+
let dayString = day.toString();
296+
if(day < 10){
297+
dayString = "0" + day.toString();
298+
}
299+
let month = pickerDate.getMonth() + 1;
300+
let monthString = month.toString();
301+
if(month < 10){
302+
monthString = "0" + month.toString();
303+
}
304+
let year = pickerDate.getFullYear();
305+
const dateString = dayString + "." + monthString+ "." + year;
306+
console.log(dateString);
307+
const dateField = await driver.findElementByText(dateString);
308+
expect(dateField).to.exist;
309+
})
309310

310-
it("Should tap button to select time and verify button text", async () => {
311-
let timeButton = await driver.findElementByText("tap to select time", SearchOptions.contains);
312-
await timeButton.click();
313-
const time = await getPickerTime(driver, 24);
314-
await clickOkBtn(driver);
315-
timeButton = await driver.findElementByText(time);
316-
expect(timeButton).to.exist;
317-
});
311+
it("Should tap button to select time and verify button text", async () => {
312+
let timeButton = await driver.findElementByText("tap to select time", SearchOptions.contains);
313+
await timeButton.click();
314+
const time = await getPickerTime(driver, 24);
315+
await clickOkBtn(driver);
316+
timeButton = await driver.findElementByText(time);
317+
expect(timeButton).to.exist;
318+
});
319+
}
318320
});

0 commit comments

Comments
 (0)