diff --git a/tests-qa/acceptance/040_Users/Details/010_Details.robot b/tests-qa/acceptance/040_Users/Details/010_Details.robot index e7a1e1ed71..5d535bb9d1 100644 --- a/tests-qa/acceptance/040_Users/Details/010_Details.robot +++ b/tests-qa/acceptance/040_Users/Details/010_Details.robot @@ -58,7 +58,7 @@ Has Public Information Go To Url ${url} Element Should Contain ${USER_PROFILE_USERNAME} ${user.name} Page Should Contain Element ${USER_PROFILE_JOIN_TIME_LABEL} - Element Should Contain ${USER_PROFILE_JOIN_TIME} second + Element Should Contain ${USER_PROFILE_JOIN_TIME} 1 week ago Page Should Contain Element ${USER_PROFILE_LANGUAGE_LABEL} Element Should Contain ${USER_PROFILE_LANGUAGE} English diff --git a/tests-qa/acceptance/080_Messaging/10_Access.robot b/tests-qa/acceptance/080_Messaging/10_Access.robot index 5f81fe6c48..80c3fb51c7 100644 --- a/tests-qa/acceptance/080_Messaging/10_Access.robot +++ b/tests-qa/acceptance/080_Messaging/10_Access.robot @@ -65,6 +65,14 @@ Users Without A Validated Email Cannot Be Contacted Go To Url ${PAGE_USER_3_CONTACT_URL} redirect=${PAGE_USER_3_PROFILE_URL} Page Should Contain This user has no valid email +New Users Cannot Contact + Sign In ${USER_4.name} Fast + Go To Url ${PAGE_USER_1_PROFILE_URL} + Page Should Not Contain Element ${USER_PROFILE_CONTACT_BUTTON} + + Go To Url ${PAGE_GEOKRETY_1_DETAILS_URL} + Page Should Not Contain Element ${GEOKRET_DETAILS_CONTACT_BUTTON} + Access By Not An Id Sign In ${USER_1.name} Fast Go To Url ${PAGE_USER_CONTACT_URL} userid=FOOBAR redirect=${PAGE_HOME_URL_EN} @@ -81,6 +89,7 @@ Access By GeoKrety Not An Id Test Setup Clear Database And Seed ${2} users Seed ${1} users with email status ${1} start_at=3 + Seed ${1} users with joined_days_ago ${1} start_at=4 Seed ${1} geokrety owned by ${1} Sign Out Fast diff --git a/tests-qa/acceptance/080_Messaging/20_SendMessage.robot b/tests-qa/acceptance/080_Messaging/20_SendMessage.robot index 55b81dd379..e98c9b32ef 100644 --- a/tests-qa/acceptance/080_Messaging/20_SendMessage.robot +++ b/tests-qa/acceptance/080_Messaging/20_SendMessage.robot @@ -8,27 +8,46 @@ Suite Setup Suite Setup ${SUBJECT} HELLO! ${MESSAGE} 🎉 Welcome to GeoKrety.org! +&{MESSAGE_2} subject=Subject message=The message *** Test Cases *** +Send Message Via User Contact Fresh Users + Sign In ${USER_3.name} Fast + Go To Url ${PAGE_USER_CONTACT_URL} userid=${USER_1.id} redirect=${PAGE_HOME_URL_EN} + + +Send Message Via User Contact Fresh Users Post + Sign In ${USER_3.name} Fast + Go To Url ${PAGE_USER_1_CONTACT_URL} redirect=${PAGE_HOME_URL_EN} + + Create Session gk ${GK_URL} + ${auth} = GET On Session gk /devel/users/${USER_3.name}/login + ${resp} = POST On Session gk url=${PAGE_USER_1_CONTACT_URL}?skip_csrf=True + ... data=&{MESSAGE_2} + ${url} = Convert To String ${resp.url} + Should Be Equal As Strings ${url} ${PAGE_HOME_URL_EN} + Delete All Sessions + Send Message Via User Contact - Sign In ${USER_1.name} Fast - Go To Url ${PAGE_USER_CONTACT_URL} userid=${USER_2.id} + Sign In ${USER_2.name} Fast + Go To Url ${PAGE_USER_CONTACT_URL} userid=${USER_1.id} Input Text ${USER_CONTACT_SUBJECT_INPUT} ${SUBJECT} Input Text ${USER_CONTACT_MESSAGE_INPUT} ${MESSAGE} Click Button ${MODAL_PANEL_SUBMIT_BUTTON} + Page Should Contain Your message to ${USER_1.name} has been sent Go To Url ${PAGE_DEV_MAILBOX_URL} - Element Should Contain ${DEV_MAILBOX_FIRST_MAIL_LINK} 💌 Contact from user ${USER_1.name} + Element Should Contain ${DEV_MAILBOX_FIRST_MAIL_LINK} 💌 Contact from user ${USER_2.name} Go To Url ${PAGE_DEV_MAILBOX_FIRST_MAIL_URL} Page Should Contain Contact from a GeoKrety.org user - Page Should Contain Hi ${USER_2.name} - Page Should Contain This email was sent by user ${USER_1.name} + Page Should Contain Hi ${USER_1.name} + Page Should Contain This email was sent by user ${USER_2.name} Page Should Contain Subject: ${SUBJECT} Page Should Contain ${MESSAGE} - Page Should Contain Reply to ${USER_1.name} - Page Should Contain Link ${PAGE_USER_1_CONTACT_URL} + Page Should Contain Reply to ${USER_2.name} + Page Should Contain Link ${PAGE_USER_2_CONTACT_URL} Sending From GeoKret Fill The Subject Sign In ${USER_1.name} Fast @@ -39,15 +58,9 @@ Sending From GeoKret Fill The Subject *** Keywords *** Suite Setup - Clear Database And Seed ${2} users - Seed ${1} geokrety owned by ${2} - Sign Out Fast + Clear Database And Seed ${1} users + Seed ${1} users with joined_days_ago ${10} start_at=2 + Seed ${1} users with joined_days_ago ${1} start_at=3 -Is Authorized - [Arguments] ${username}=${USER_1.name} - Sign In ${username} Fast - Go To Url ${PAGE_GEOKRETY_DETAILS_1_CONTACT_OWNER_URL} - Page Should Not Contain ${UNAUTHORIZED} - Wait Until Panel Contact user - Page Should Contain Element ${USER_CONTACT_SUBJECT_INPUT} - Page Should Contain Element ${USER_CONTACT_MESSAGE_INPUT} + Seed ${1} geokrety owned by ${1} + Sign Out Fast diff --git a/tests-qa/acceptance/ressources/ComponentsLocator.robot b/tests-qa/acceptance/ressources/ComponentsLocator.robot index 66f937199a..910b83d76a 100644 --- a/tests-qa/acceptance/ressources/ComponentsLocator.robot +++ b/tests-qa/acceptance/ressources/ComponentsLocator.robot @@ -47,6 +47,7 @@ ${GEOKRET_CREATE_LABEL_TEMPLATE_SELECT} //*[@id="inputLabelTemplate"] ${GEOKRET_DETAILS_DETAILS_PANEL} //*[@id="geokretyDetailsPanel"] ${GEOKRET_DETAILS_DETAILS_PANEL_HEADING} ${GEOKRET_DETAILS_DETAILS_PANEL}/div[contains(@class, "panel-heading")] ${GEOKRET_DETAILS_DETAILS_PANEL_BODY} ${GEOKRET_DETAILS_DETAILS_PANEL}/div[contains(@class, "panel-body")] +${GEOKRET_DETAILS_CONTACT_BUTTON} //*[@id="userContactButton"] ${GEOKRET_DETAILS_NAME} ${GEOKRET_DETAILS_DETAILS_PANEL}/div[@class="panel-heading"]/a[@data-gk-link="geokret"] ${GEOKRET_DETAILS_TYPE} ${GEOKRET_DETAILS_DETAILS_PANEL}/div[@class="panel-heading"]/small diff --git a/tests-qa/acceptance/ressources/Devel.robot b/tests-qa/acceptance/ressources/Devel.robot index e8944bc71c..d2ba019b0d 100644 --- a/tests-qa/acceptance/ressources/Devel.robot +++ b/tests-qa/acceptance/ressources/Devel.robot @@ -127,6 +127,11 @@ Seed ${count} users with email status ${email_status} Go To Url Fast ${PAGE_SEED_USER}?email_invalid\=${email_status}&i\=${start_at} count=${count} Empty Dev Mailbox Fast +Seed ${count} users with joined_days_ago ${joined_days_ago} + [Arguments] ${start_at}=1 + Go To Url Fast ${PAGE_SEED_USER}?joined_days_ago\=${joined_days_ago}&i\=${start_at} count=${count} + Empty Dev Mailbox Fast + Seed ${count} users without terms of use with status ${status} Go To Url Fast ${PAGE_SEED_USER}/status/${status}/no-terms-of-use count=${count} Empty Dev Mailbox Fast diff --git a/website/app-templates/smarty/blocks/geokret/details.tpl b/website/app-templates/smarty/blocks/geokret/details.tpl index 8a89d019fb..cc7dd7df1d 100644 --- a/website/app-templates/smarty/blocks/geokret/details.tpl +++ b/website/app-templates/smarty/blocks/geokret/details.tpl @@ -29,8 +29,8 @@ {/if}