+
Trip Timeline
+
{days.map((day, index) => (
/support/config/jest.setup.local.js"],
- "testTimeout": 30000
+ "testTimeout": 60000
}
\ No newline at end of file
diff --git a/tests/specs/integration/timeline-scheduling.test.js b/tests/specs/integration/timeline-scheduling.test.js
index 7f65fc1..f65d4be 100644
--- a/tests/specs/integration/timeline-scheduling.test.js
+++ b/tests/specs/integration/timeline-scheduling.test.js
@@ -110,9 +110,14 @@ describe('Timeline Scheduling Feature Test', () => {
// Helper function to create a plannable item
async function createPlannableItem(itemData) {
- // Click Add Item button in sidebar
+ // Ensure no modal is already open
+ await driver.sleep(500);
+
+ // Click Add Item button in sidebar using JavaScript click
const addItemButton = await driver.findElement(By.xpath('//button[contains(text(), "Add Item")]'));
- await addItemButton.click();
+ await driver.executeScript("arguments[0].scrollIntoView(true);", addItemButton);
+ await driver.sleep(300);
+ await driver.executeScript("arguments[0].click();", addItemButton);
// Wait for form modal
await driver.wait(until.elementLocated(By.className('plannable-form-modal')), 5000);
@@ -142,7 +147,7 @@ describe('Timeline Scheduling Feature Test', () => {
// Wait for modal to close
await driver.sleep(1500);
await driver.wait(async () => {
- const overlays = await driver.findElements(By.css('.plannable-form-overlay'));
+ const overlays = await driver.findElements(By.css('.plannable-form-overlay, .plannable-form-modal'));
for (const overlay of overlays) {
try {
if (await overlay.isDisplayed()) {
@@ -154,6 +159,9 @@ describe('Timeline Scheduling Feature Test', () => {
}
return true;
}, 10000);
+
+ // Additional wait to ensure UI is stable
+ await driver.sleep(500);
}
// Helper to wait for modal close
@@ -211,15 +219,15 @@ describe('Timeline Scheduling Feature Test', () => {
// Get first day section
const firstDaySection = await driver.findElement(By.className('day-section'));
- // Should have hour rows (6 AM to 11 PM = 18 hours)
+ // Should have hour rows (06:00 to 23:00 = 18 hours)
const hourRows = await firstDaySection.findElements(By.className('hour-row'));
expect(hourRows.length).toBeGreaterThanOrEqual(18);
// Verify specific hour labels exist
- const hour6am = await driver.findElement(By.xpath('//div[contains(@class, "hour-label") and contains(text(), "6:00 AM")]'));
+ const hour6am = await driver.findElement(By.xpath('//div[contains(@class, "hour-label") and contains(text(), "06:00")]'));
expect(await hour6am.isDisplayed()).toBe(true);
- const hour11pm = await driver.findElement(By.xpath('//div[contains(@class, "hour-label") and contains(text(), "11:00 PM")]'));
+ const hour11pm = await driver.findElement(By.xpath('//div[contains(@class, "hour-label") and contains(text(), "23:00")]'));
expect(await hour11pm.isDisplayed()).toBe(true);
});
});
@@ -250,8 +258,8 @@ describe('Timeline Scheduling Feature Test', () => {
notes: 'Morning coffee'
});
- // Now find the 8 AM hour row
- const hour8am = await driver.findElement(By.xpath('//div[contains(@class, "hour-label") and contains(text(), "8:00 AM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ // Now find the 08:00 hour row
+ const hour8am = await driver.findElement(By.xpath('//div[contains(@class, "hour-label") and contains(text(), "08:00")]/following-sibling::div[contains(@class, "hour-content")]'));
// Hover to show + button
await driver.actions().move({ origin: hour8am }).perform();
@@ -285,11 +293,11 @@ describe('Timeline Scheduling Feature Test', () => {
await driver.sleep(1000);
- // Find the 10 AM hour row on Day 1
+ // Find the 10:00 hour row on Day 1
const daySections = await driver.findElements(By.className('day-section'));
const day1Section = daySections[0];
- const hour10am = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "10:00 AM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ const hour10am = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "10:00")]/following-sibling::div[contains(@class, "hour-content")]'));
// Hover and click +
await driver.actions().move({ origin: hour10am }).perform();
@@ -321,12 +329,12 @@ describe('Timeline Scheduling Feature Test', () => {
// Wait for modal to close
await waitForModalClose();
- // Verify item appears in timeline at 10 AM
+ // Verify item appears in timeline at 10:00
await driver.sleep(1000);
const scheduledItem = await driver.findElement(By.xpath('//div[contains(@class, "scheduled-slot") and contains(., "Louvre Museum Visit")]'));
expect(await scheduledItem.isDisplayed()).toBe(true);
- // Verify time display shows 10:00 AM - 12:00 PM
+ // Verify time display shows 10:00 - 12:00
const timeDisplay = await scheduledItem.getText();
expect(timeDisplay).toContain('10:00');
expect(timeDisplay).toContain('12:00');
@@ -350,11 +358,11 @@ describe('Timeline Scheduling Feature Test', () => {
await driver.sleep(1000);
- // Schedule first item at 8 AM
+ // Schedule first item at 08:00
const daySections = await driver.findElements(By.className('day-section'));
const day2Section = daySections[1]; // Day 2
- const hour8am = await day2Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "8:00 AM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ const hour8am = await day2Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "08:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour8am }).perform();
await driver.sleep(500);
@@ -371,8 +379,8 @@ describe('Timeline Scheduling Feature Test', () => {
await driver.sleep(1000);
- // Schedule second item at 3 PM
- const hour3pm = await day2Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "3:00 PM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ // Schedule second item at 15:00
+ const hour3pm = await day2Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "15:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour3pm }).perform();
await driver.sleep(500);
@@ -411,11 +419,11 @@ describe('Timeline Scheduling Feature Test', () => {
await driver.sleep(1000);
- // Open schedule modal at 2 PM
+ // Open schedule modal at 14:00
const daySections = await driver.findElements(By.className('day-section'));
const day3Section = daySections[2]; // Day 3
- const hour2pm = await day3Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "2:00 PM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ const hour2pm = await day3Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "14:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour2pm }).perform();
await driver.sleep(500);
@@ -463,7 +471,7 @@ describe('Timeline Scheduling Feature Test', () => {
const daySections = await driver.findElements(By.className('day-section'));
const day1Section = daySections[0];
- const hour11am = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "11:00 AM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ const hour11am = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "11:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour11am }).perform();
await driver.sleep(500);
@@ -502,8 +510,8 @@ describe('Timeline Scheduling Feature Test', () => {
const daySections = await driver.findElements(By.className('day-section'));
const day1Section = daySections[0];
- // Schedule Dinner first (7 PM)
- const hour7pm = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "7:00 PM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ // Schedule Dinner first (19:00)
+ const hour7pm = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "19:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour7pm }).perform();
await driver.sleep(500);
await hour7pm.findElement(By.css('button')).click();
@@ -515,8 +523,8 @@ describe('Timeline Scheduling Feature Test', () => {
await waitForModalClose();
await driver.sleep(1000);
- // Schedule Breakfast (7 AM)
- const hour7am = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "7:00 AM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ // Schedule Breakfast (07:00)
+ const hour7am = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "07:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour7am }).perform();
await driver.sleep(500);
await hour7am.findElement(By.css('button')).click();
@@ -528,8 +536,8 @@ describe('Timeline Scheduling Feature Test', () => {
await waitForModalClose();
await driver.sleep(1000);
- // Schedule Lunch (12 PM)
- const hour12pm = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "12:00 PM")]/following-sibling::div[contains(@class, "hour-content")]'));
+ // Schedule Lunch (12:00)
+ const hour12pm = await day1Section.findElement(By.xpath('.//div[contains(@class, "hour-label") and contains(text(), "12:00")]/following-sibling::div[contains(@class, "hour-content")]'));
await driver.actions().move({ origin: hour12pm }).perform();
await driver.sleep(500);
await hour12pm.findElement(By.css('button')).click();