Skip to content

Commit

Permalink
Missing tasks (#27)
Browse files Browse the repository at this point in the history
Fix missing tasks
  • Loading branch information
samuelgm-openai authored Feb 20, 2025
1 parent 55440fe commit dc59971
Show file tree
Hide file tree
Showing 16 changed files with 561 additions and 0 deletions.
1 change: 1 addition & 0 deletions issues/18909_734/commit_id.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2b791c9f3053c1682ddcb50ab036deb3e55a7542
Binary file added issues/18909_734/flow.mitm
Binary file not shown.
Empty file added issues/18909_734/git_tag.txt
Empty file.
1 change: 1 addition & 0 deletions issues/18909_734/issue_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"price": 1000.0, "title": "[HOLD for payment 2023-06-12] [$1000] Padding above \u201cno result found\u201d error in message input \u201cEmoji- Search bar\u201d is not consistent.", "issue_repo_steps": "Action performed: 1. Open \u201cChats\u201d\r\n2. Click \u201cEmoji\u201d.\r\n3. Search an invalid Emoji, so that \u201cno result found\u201d error appear.\r\n4. Observe that the bottom padding of the input field is 8px 16px.\r\n5. Please note that all below search bar reflects padding of 0px 20px 12px on search of an invalid item.\r\nSearch bar next to chats.\r\nSend money- select a currency.\r\nProfile- Pronouns\r\nProfile- Timezone\r\nDOB-Year\n\nExpected result: None\n\nActual result: None"}
39 changes: 39 additions & 0 deletions issues/18909_734/issue_introduction.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/src/components/EmojiPicker/CategoryShortcutBar.tsx b/src/components/EmojiPicker/CategoryShortcutBar.tsx
index 25c1ff85f6a..e440e8c7a97 100644
--- a/src/components/EmojiPicker/CategoryShortcutBar.tsx
+++ b/src/components/EmojiPicker/CategoryShortcutBar.tsx
@@ -15,7 +15,7 @@ type CategoryShortcutBarProps = {
function CategoryShortcutBar({onPress, headerEmojis}: CategoryShortcutBarProps) {
const styles = useThemeStyles();
return (
- <View style={[styles.ph4, styles.flexRow]}>
+ <View style={[styles.pt2, styles.ph4, styles.flexRow]}>
{headerEmojis.map((headerEmoji) => (
<CategoryShortcutButton
icon={headerEmoji.icon}
diff --git a/src/components/EmojiPicker/EmojiPickerMenu/index.tsx b/src/components/EmojiPicker/EmojiPickerMenu/index.tsx
index d6c1e1f9255..3e38f03eadc 100755
--- a/src/components/EmojiPicker/EmojiPickerMenu/index.tsx
+++ b/src/components/EmojiPicker/EmojiPickerMenu/index.tsx
@@ -322,7 +322,7 @@ function EmojiPickerMenu({onEmojiSelected, activeEmoji}: EmojiPickerMenuProps, r
arePointerEventsDisabled ? styles.pointerEventsNone : styles.pointerEventsAuto,
]}
>
- <View style={[styles.ph4, styles.pb3, styles.pt2]}>
+ <View style={[styles.ph4, styles.pb2, styles.pt2]}>
<TextInput
label={translate('common.search')}
accessibilityLabel={translate('common.search')}
diff --git a/src/pages/workspace/WorkspaceMembersPage.tsx b/src/pages/workspace/WorkspaceMembersPage.tsx
index 52b8a06ba93..d86a47b48e6 100644
--- a/src/pages/workspace/WorkspaceMembersPage.tsx
+++ b/src/pages/workspace/WorkspaceMembersPage.tsx
@@ -662,7 +662,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
isVisible={isDownloadFailureModalVisible}
onClose={() => setIsDownloadFailureModalVisible(false)}
/>
- <View style={[styles.w100, styles.flex1]}>
+ <View style={[styles.w100, styles.pv4, styles.flex1]}>
<SelectionListWithModal
ref={selectionListRef}
canSelectMultiple={canSelectMultiple}
Empty file.
75 changes: 75 additions & 0 deletions issues/18909_734/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import sys, os

base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, base_path)

import time
import random
import re
from playwright.sync_api import sync_playwright, expect
from playwright.sync_api._context_manager import PlaywrightContextManager
from playwright._impl._browser import Browser
from playwright._impl._page import Page


def generate_random_email():
return "redx224+6856@gmail.com"


def login_user(p: PlaywrightContextManager, first_name="Milan", last_name="T") -> tuple[Browser, Page, str]:

browser = p.chromium.launch(channel="chrome", headless=True, args=[
"--disable-web-security",
"--disable-features=IsolateOrigins,site-per-process"
])
page = browser.new_page()
user_email = generate_random_email()


page.goto('https://dev.new.expensify.com:8082/')


page.locator('input[type="email"]').fill(user_email)
page.get_by_role("button", name="Continue").click()


page.get_by_role("button", name="Join").click()

page.wait_for_selector("text=What do you want to do today?")
expect(page.locator("text=What do you want to do today?")).to_be_visible()


page.locator("text='Track and budget expenses'").click()
page.get_by_role("button", name="Continue").click()
page.wait_for_timeout(500)


page.locator('input[name="fname"]').fill(first_name)
page.locator('input[name="lname"]').fill(last_name)
page.get_by_role("button", name="Continue").last.click()
page.wait_for_timeout(500)

return browser, page, user_email


def test_issue_18909():
with sync_playwright() as p:

browser, page, user_email = login_user(p)

own_chat = page.get_by_text("Milan T (you)")
expect(own_chat).to_be_visible()
own_chat.click()
page.wait_for_timeout(500)

emoji = page.locator('div[aria-label="Emoji"]').nth(1)
expect(emoji).to_be_visible()
emoji.click()
page.wait_for_timeout(500)

page.locator('input[aria-label="Search"]').nth(0).fill("avsfb")
test = page.locator("div").filter(has_text=re.compile(r"^Search$")).first
page.wait_for_timeout(500)
expect(test).to_have_css("padding", "8px 16px 12px")

browser.close()
90 changes: 90 additions & 0 deletions issues/18909_734/user_tool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import sys, os

base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, base_path)

import time
import random
import re
from playwright.sync_api import sync_playwright, expect
from playwright.sync_api._context_manager import PlaywrightContextManager
from playwright._impl._browser import Browser
from playwright._impl._page import Page
from utils.trace_cleaner import trace_cleaner


def generate_random_email():
return "redx224+6856@gmail.com"


def login_user(p: PlaywrightContextManager, first_name="Milan", last_name="T") -> tuple[Browser, Page, str]:

browser = p.chromium.launch(channel="chrome", headless=True, args=[
"--disable-web-security",
"--disable-features=IsolateOrigins,site-per-process"
])
context = browser.new_context()


context.tracing.start(screenshots=True, snapshots=True, sources=True)

page = context.new_page()
user_email = generate_random_email()


page.goto('https://dev.new.expensify.com:8082/')


page.locator('input[type="email"]').fill(user_email)
page.get_by_role("button", name="Continue").click()


page.get_by_role("button", name="Join").click()

page.wait_for_selector("text=What do you want to do today?")
expect(page.locator("text=What do you want to do today?")).to_be_visible()


page.locator("text='Track and budget expenses'").click()
page.get_by_role("button", name="Continue").click()
page.wait_for_timeout(500)


page.locator('input[name="fname"]').fill(first_name)
page.locator('input[name="lname"]').fill(last_name)
page.get_by_role("button", name="Continue").last.click()
page.wait_for_timeout(500)


return browser, page, user_email


def test_issue_18909():
with sync_playwright() as p:
browser, page, user_email = login_user(p)

context = page.context
try:
own_chat = page.get_by_text("Milan T (you)")
expect(own_chat).to_be_visible()
own_chat.click()
page.wait_for_timeout(500)

emoji = page.locator('div[aria-label="Emoji"]').nth(1)
expect(emoji).to_be_visible()
emoji.click()
page.wait_for_timeout(500)

page.locator('input[aria-label="Search"]').nth(0).fill("avsfb")
test = page.locator("div").filter(has_text=re.compile(r"^Search$")).first
page.wait_for_timeout(500)
expect(test).to_have_css("padding", "8px 16px 12px")
except Exception as e:

raise e
finally:

context.tracing.stop(path="/app/expensify/user_tool/output_browser1.zip")
trace_cleaner("/app/expensify/user_tool/output_browser1.zip")

browser.close()
1 change: 1 addition & 0 deletions issues/19023_868/commit_id.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2b791c9f3053c1682ddcb50ab036deb3e55a7542
Binary file added issues/19023_868/flow.mitm
Binary file not shown.
Empty file added issues/19023_868/git_tag.txt
Empty file.
1 change: 1 addition & 0 deletions issues/19023_868/issue_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"price": 1000.0, "title": "[HOLD for payment 2023-06-02] [$1000] On task title editing page when title field is empty than error message is `This field is required` instead of `please enter a title`", "issue_repo_steps": "Action performed: 1. Launch the app -> Login in account\r\n2. Click on FAB button -> Click on Assign task option\r\n3. Enter title -> Assign task -> Click on confirm task -> will navigate to task detail page\r\n4. On task detail page click on Task (name) -> clear title field and press save -> Notice error message is `This field is required` instead of `please enter a title`\n\nExpected result: None\n\nActual result: None"}
13 changes: 13 additions & 0 deletions issues/19023_868/issue_introduction.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/pages/tasks/TaskTitlePage.tsx b/src/pages/tasks/TaskTitlePage.tsx
index 900809256c4..b56baa4ee30 100644
--- a/src/pages/tasks/TaskTitlePage.tsx
+++ b/src/pages/tasks/TaskTitlePage.tsx
@@ -39,7 +39,7 @@ function TaskTitlePage({report, currentUserPersonalDetails}: TaskTitlePageProps)
const errors: FormInputErrors<typeof ONYXKEYS.FORMS.EDIT_TASK_FORM> = {};

if (!title) {
- ErrorUtils.addErrorMessage(errors, INPUT_IDS.TITLE, translate('newTaskPage.pleaseEnterTaskName'));
+ ErrorUtils.addErrorMessage(errors, INPUT_IDS.TITLE, translate('common.error.fieldRequired'));
} else if (title.length > CONST.TITLE_CHARACTER_LIMIT) {
ErrorUtils.addErrorMessage(errors, INPUT_IDS.TITLE, translate('common.error.characterLimitExceedCounter', {length: title.length, limit: CONST.TITLE_CHARACTER_LIMIT}));
}
Empty file.
161 changes: 161 additions & 0 deletions issues/19023_868/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import sys, os

base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, base_path)

import re
import time
from playwright.sync_api import sync_playwright, expect
from playwright.sync_api._context_manager import PlaywrightContextManager
from playwright._impl._browser import Browser
from playwright._impl._page import Page
import time
import imaplib
import email
from email.header import decode_header
import re

USER_EMAIL = "playwright2user+1@gmail.com"
PASSWORD = "zehr mglm gizg gjcc"

def fetch_verification_code_from_email(user_email, password, retries=10, delay=10):
"""
Fetch the OTP code from the latest email.
"""
imap = imaplib.IMAP4_SSL("imap.gmail.com")
imap.login(user_email, password)

for attempt in range(retries):
imap.select("inbox")
status, messages = imap.search(
None, '(UNSEEN SUBJECT "Expensify magic sign-in code")'
)
if status == "OK":
email_ids = messages[0].split()

if email_ids:

latest_email_id = email_ids[-1]
status, msg_data = imap.fetch(latest_email_id, "(RFC822)")

for response_part in msg_data:
if isinstance(response_part, tuple):
msg = email.message_from_bytes(response_part[1])


if msg.is_multipart():
for part in msg.walk():
content_type = part.get_content_type()
if content_type == "text/plain":
body = part.get_payload(decode=True).decode()
match = re.search(r'\b\d{6}\b', body)
if match:
otp_code = match.group(0)
imap.logout()
return otp_code
else:

body = msg.get_payload(decode=True).decode()
match = re.search(r'\b\d{6}\b', body)
if match:
otp_code = match.group(0)
imap.logout()
return otp_code
else:
print("No new emails found. Retrying...")
otp_code="123456"
return otp_code
else:
print("Failed to retrieve emails. Retrying...")


time.sleep(delay)

imap.logout()
raise Exception("Max retries reached. No magic code email found.")


def generate_random_email():
timestamp = int(time.time())
return f"testuser{timestamp}@gmail.com"


def login_user(p: PlaywrightContextManager, first_name="Ayush", last_name="G") -> tuple[Browser, Page, str]:

browser = p.chromium.launch(
headless=True, # Set to False to see the browser
args=[
"--disable-web-security", # Disable CORS (for testing only)
"--disable-features=IsolateOrigins,site-per-process"
])
context = browser.new_context(ignore_https_errors=True)
page = context.new_page()
user_email = USER_EMAIL


page.goto('https://dev.new.expensify.com:8082/')


page.locator('input[type="email"]').fill(user_email)
page.locator('button[tabindex="0"]').click()
time.sleep(1)

verification_code = fetch_verification_code_from_email(user_email, PASSWORD)


otp_input = page.locator("[autocomplete='one-time-code']")
expect(otp_input).to_be_visible()
otp_input.fill(verification_code)


try:
page.locator('button[tabindex="0"]').click()
time.sleep(1)
except Exception:
pass


return browser, page, user_email


def test_save_description_in_submitted_expense():
with sync_playwright() as p:

browser, page, user_email = login_user(p)
page.wait_for_timeout(5000)

page.locator('span:text("Test (you)")').first.click()

plus_create_icon = page.locator('button[aria-label="Create"]').last
expect(plus_create_icon).to_be_visible()
plus_create_icon.click()

page.get_by_text("Assign task").click()
page.get_by_role("textbox", name="Title").fill("sample title")
page.get_by_role("textbox", name="Title").press("Tab")
page.get_by_role("textbox", name="Description (optional)").fill("sample description")
page.get_by_role("button", name="Next").click()

page.locator('button div:text("Confirm task")').nth(0).click()
page.wait_for_timeout(5000)

task_title_div = page.locator('div[data-testid="comment"] div:has-text("sample title")').last
task_title_div.click()

expanded_task_title_div = page.locator('div[aria-label="sample title"]').first
expanded_task_title_div.click()

page.get_by_role("textbox", name="Title").fill("")
page.get_by_role("button", name="Save").click()
page.wait_for_timeout(10000)


title_missing_warning = page.locator('div:text("Please enter a title")')
expect(title_missing_warning).to_be_visible()

page.wait_for_timeout(10000)

field_required_warning = page.locator('div:text("This field is required.")')
expect(field_required_warning).to_be_hidden()
browser.close()

Loading

0 comments on commit dc59971

Please sign in to comment.