@@ -47,6 +47,7 @@ export default class ScheduledDraftModal {
|
||||
await this.dateInput.click();
|
||||
|
||||
const pacificDate = this.getPacificDate();
|
||||
const originDate = new Date(pacificDate.getTime());
|
||||
|
||||
// If dayFromToday is provided, add days to the current date
|
||||
if (dayFromToday) {
|
||||
@@ -57,7 +58,13 @@ export default class ScheduledDraftModal {
|
||||
const month = pacificDate.toLocaleString('default', {month: 'long'});
|
||||
const dayOfWeek = pacificDate.toLocaleDateString('en-US', {weekday: 'long'});
|
||||
|
||||
await this.dateLocator(day, month, dayOfWeek).click();
|
||||
const dl = this.dateLocator(day, month, dayOfWeek);
|
||||
|
||||
// If the date is not visible and the month has changed, click the next month button
|
||||
if (!(await dl.isVisible()) && pacificDate.getMonth() !== originDate.getMonth()) {
|
||||
this.container.locator('button[aria-label="Go to next month"]').click();
|
||||
}
|
||||
await dl.click();
|
||||
}
|
||||
|
||||
async confirm() {
|
||||
|
||||
@@ -12,6 +12,7 @@ export default class SearchPopover {
|
||||
readonly searchBoxClose;
|
||||
readonly selectedSuggestion;
|
||||
readonly searchHints;
|
||||
readonly clearButton;
|
||||
|
||||
constructor(container: Locator) {
|
||||
this.container = container;
|
||||
@@ -22,6 +23,16 @@ export default class SearchPopover {
|
||||
this.searchBoxClose = container.getByTestId('searchBoxClose');
|
||||
this.selectedSuggestion = container.locator('.suggestion--selected').locator('.suggestion-list__main');
|
||||
this.searchHints = container.locator('#searchHints');
|
||||
this.clearButton = container.locator('.input-clear-x');
|
||||
}
|
||||
|
||||
// clearIfPossible clears the search input if the clear button is visible. Returns true if the clear button was clicked.
|
||||
async clearIfPossible() {
|
||||
if (await this.clearButton.isVisible()) {
|
||||
await this.clearButton.click();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async toBeVisible() {
|
||||
|
||||
@@ -29,7 +29,8 @@ export default class ChannelsSidebarRight {
|
||||
this.scheduledDraftChannelInfoMessageText = container.locator('span:has-text("Message scheduled for")');
|
||||
this.rhsPostBody = container.locator('.post-message__text');
|
||||
this.postCreate = new components.ChannelsPostCreate(container.getByTestId('comment-create'), true);
|
||||
this.closeButton = container.locator('#rhsCloseButton');
|
||||
this.closeButton = container.locator('.sidebar--right__close');
|
||||
|
||||
this.editTextbox = container.locator('#edit_textbox');
|
||||
this.postEdit = new components.ChannelsPostEdit(container.locator('.post-edit__container'));
|
||||
this.currentVersionEditedPosttext = (postID: any) => container.locator(`#rhsPostMessageText_${postID} p`);
|
||||
|
||||
Ссылка в новой задаче
Block a user