Skip to content

Commit

Permalink
Merge pull request #4579 from will-moore/right_panel_annotation_tabs
Browse files Browse the repository at this point in the history
Right panel annotation tabs
  • Loading branch information
jburel committed May 3, 2016
2 parents 884f5de + 57ffa62 commit 44642c4
Show file tree
Hide file tree
Showing 41 changed files with 2,615 additions and 1,054 deletions.
10 changes: 5 additions & 5 deletions components/tests/ui/resources/web/tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,11 @@ Wait Until Right Panel Loads Everything

Wait Until Right Panel Loads ${containerType} ${containerId}
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/h1[contains(text(),'${containerType} Details')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/h1[contains(text(),'Tags')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/h1[contains(text(),'Key-Value Pairs')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/h1[contains(text(),'Attachments')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/h1[contains(text(),'Ratings')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/h1[contains(text(),'Comments')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/div/h1[contains(text(),'Tags')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/div/h1[contains(text(),'Key-Value Pairs')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/div/h1[contains(text(),'Attachments')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/div/h1[contains(text(),'Ratings')]
Wait Until Element Is Visible xpath=//*[@id="general_tab"]/div/h1[contains(text(),'Comments')]
Run Keyword If '${containerType}' == 'Project' Wait Until Element Is Visible ${detailsPane}//th[contains(text(),'Creation Date:')]
Run Keyword If '${containerType}' == 'Dataset' Wait Until Element Is Visible ${detailsPane}//th[contains(text(),'Creation Date:')]
Run Keyword If '${containerType}' == 'Image' Check Right Panel Image
Expand Down
9 changes: 9 additions & 0 deletions components/tests/ui/robot_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TINY_IMAGE_NAME=${TINY_IMAGE_NAME:-test&acquisitionDate=2012-01-01_00-00-00.fake
MIF_IMAGE_NAME=${MIF_IMAGE_NAME:-test&series=3.fake}
PLATE_NAME=${PLATE_NAME:-test&plates=1&plateAcqs=1&plateRows=2&plateCols=3&fields=1&screens=0.fake}
BULK_ANNOTATION_CSV=${BULK_ANNOTATION_CSV:-bulk_annotation.csv}
FILE_ANNOTATION=${FILE_ANNOTATION:-robot_file_annotation.txt}

# Create robot user and group
bin/omero login root@$HOSTNAME:$PORT -w $ROOT_PASSWORD
Expand All @@ -41,6 +42,9 @@ echo "Well,Well Type,Concentration" > "$BULK_ANNOTATION_CSV"
echo "A1,Control,0" >> "$BULK_ANNOTATION_CSV"
echo "A2,Treatment,10" >> "$BULK_ANNOTATION_CSV"

# Create file for upload as File Annotation
echo "Robot test file annotations" > "$FILE_ANNOTATION"

# Create robot setup
bin/omero login $USER_NAME@$HOSTNAME:$PORT -w $USER_PASSWORD
# Parse the sessions file to get session key
Expand Down Expand Up @@ -113,6 +117,11 @@ do
bin/omero import $TINY_IMAGE_NAME --debug ERROR
done

# Uplodad file and create FileAnnotation
bin/omero upload $FILE_ANNOTATION > file_upload.log
fileId=$(sed "s/^Uploaded $FILE_ANNOTATION as //" file_upload.log)
bin/omero obj new FileAnnotation file=OriginalFile:$fileId

# Logout
bin/omero logout

Expand Down
221 changes: 221 additions & 0 deletions components/tests/ui/testcases/web/annotate_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
*** Settings ***
Documentation Tests submission of forms.

Resource ../../resources/config.txt
Resource ../../resources/web/login.txt
Resource ../../resources/web/tree.txt

Suite Setup Run Keywords User "${USERNAME}" logs in with password "${PASSWORD}" Maximize Browser Window
Suite Teardown Close all browsers

*** Variables ***
${commentText} Robot test adding this comment
${commentTextTwo} A second comment added by Robot test
${commentTextThree} This will be added to Two Datasets
${commentTextFour} I (Robot) just love adding comments!
${fileName} robot_file_annotation.txt
${fileNameTwo} bulk_annotations
${SEARCH URL} ${WELCOME URL}search/


*** Keywords ***

Check For Comment
[Arguments] ${text}
Wait Until Page Contains Element xpath=//div[@class='commentText'][contains(text(), '${text}')]

Check Comment Gone
[Arguments] ${text}
Page Should Not Contain Element xpath=//div[@class='commentText'][contains(text(), '${text}')]

Add Comment
[Arguments] ${text}
Wait Until Element Is Visible id=id_comment
Input Text comment ${text}
Submit Form add_comment_form
Check For Comment ${text}

Remove Comment
[Arguments] ${text}
Click Element xpath=//div[contains(@class, 'ann_comment_text')][descendant::div[contains(text(), '${text}')]]/img[@class='removeComment']
Click Dialog Button OK
Wait Until Keyword Succeeds ${TIMEOUT} ${INTERVAL} Check Comment Gone ${text}


Add File Annotation
[Arguments] ${fileAnnotationName}
Wait Until Element Is Visible id=choose_file_anns
Click Element id=choose_file_anns
Wait Until Page Contains Element id=id_files
# Click Element xpath=//select[@id='id_files']/option[contains(text(), ${fileName})]
Select From List By Label id=id_files ${fileAnnotationName}
Click Dialog Button Accept
Check For File Annotation ${fileAnnotationName}

Check For File Annotation
[Arguments] ${fileAnnotationName}
Wait Until Element Is Visible xpath=//li[contains(@class, 'file_ann_wrapper')][descendant::a[contains(text(), '${fileAnnotationName}')]]//*[@class='removeFile action']
Wait Until Element Is Visible xpath=//li[contains(@class, 'file_ann_wrapper')][descendant::a[contains(text(), '${fileAnnotationName}')]]//a[@class='deleteFile action']
Wait Until Element Is Visible xpath=//ul[@id="fileanns_container"]//a[contains(text(), '${fileAnnotationName}')]
Wait Until Element Is Visible xpath=//li[contains(@class, 'file_ann_wrapper')][descendant::a[contains(text(), '${fileAnnotationName}')]]//span
# Mouse Over //ul[@id="fileanns_container"]//a[contains(@class, 'tooltip')]
# Wait Until Element Is Visible //ul[@id="fileanns_container"]//a[contains(@class, 'tooltip')][contains(@aria-describedby, 'ui-tooltip')]

Remove File Annotation
[Arguments] ${fileAnnotationName}

Wait Until Element Is Visible xpath=//li[contains(@class, 'file_ann_wrapper')][descendant::a[contains(text(), '${fileAnnotationName}')]]//*[@class='removeFile action']
Click Element xpath=//li[contains(@class, 'file_ann_wrapper')][descendant::*[contains(text(), '${fileAnnotationName}')]]//*[@class='removeFile action']

Click Dialog Button OK
Wait Until Keyword Succeeds ${TIMEOUT} ${INTERVAL} Check File Annotation Gone ${fileAnnotationName}

Check File Annotation Gone
[Arguments] ${fileAnnotationName}
Page Should Not Contain Element xpath=//ul[@id="fileanns_container"]//a[contains(text(), '${fileAnnotationName}')]


*** Test Cases ***

Test Comments

Select Experimenter
${dsId_One}= Create Dataset robot test comments_1
${dsId_Two}= Create Dataset robot test comments_2

# Comment a single Dataset
Click Element xpath=//h1[@data-name='comments']
Add Comment ${commentText}

# Refresh (select other Dataset and re-select)
${nodeId}= Select Dataset By Id ${dsId_One}
Wait Until Right Panel Loads Dataset ${dsId_One}
Select Dataset By Id ${dsId_Two}
# Check and add another Comment
Check For Comment ${commentText}
Add Comment ${commentTextTwo}
# Remove first comment
Remove Comment ${commentText}

# Now select both Datasets...
Meta Click Node ${nodeId}
Wait Until Page Contains Element id=batch_ann_title
# Previously added Comment will show up
Check For Comment ${commentTextTwo}
Page Should Not Contain Element xpath=//div[@class='commentText'][contains(text(), '${commentText}')]
# Add Comments to Both Datasets
Add Comment ${commentTextThree}
Add Comment ${commentTextFour}

# Select each single Dataset to check for Comment(s)
Select Dataset By Id ${dsId_One}
Check Comment Gone ${commentTextTwo}
Check For Comment ${commentTextThree}
Select Dataset By Id ${dsId_Two}
Check For Comment ${commentTextTwo}
Check For Comment ${commentTextThree}

# Select both Datasets and Remove Comments
Meta Click Node ${nodeId}
Wait Until Page Contains Element id=batch_ann_title
Remove Comment ${commentTextTwo}
Remove Comment ${commentTextThree}

# Select each single Dataset again to check for Comment(s)
Select Dataset By Id ${dsId_One}
Check For Comment ${commentTextFour}
Check Comment Gone ${commentTextTwo}
Check Comment Gone ${commentTextThree}
Select Dataset By Id ${dsId_Two}
Check For Comment ${commentTextFour}
Check Comment Gone ${commentTextTwo}
Check Comment Gone ${commentTextThree}

Select Dataset By Id ${dsId_One}
Delete Container

Select Dataset By Id ${dsId_Two}
Delete Container


Test File Annotations

Select Experimenter
${sId_One}= Create Screen robot file annotations_1
${sId_Two}= Create Screen robot file annotations_2

# Annotate single Screen
Click Element xpath=//h1[@data-name='attachments']
Add File Annotation ${fileName}

# Refresh (select other Screen and re-select)
${nodeId}= Select Screen By Id ${sId_One}
Wait Until Right Panel Loads Screen ${sId_One}
Select Screen By Id ${sId_Two}
# Check and add another File Annotation
Check For File Annotation ${fileName}
Add File Annotation ${fileNameTwo}
# Remove first File Annotation
Remove File Annotation ${fileName}

# Now select both Screens...
Meta Click Node ${nodeId}
Wait Until Page Contains Element id=batch_ann_title
# Previously added File Annotation will show up
Check For File Annotation ${fileNameTwo}
Check File Annotation Gone ${fileName}
# Add File Annotation to Both Screens
Add File Annotation ${fileName}
Select Screen By Id ${sId_One}
Check For File Annotation ${fileName}
Select Screen By Id ${sId_Two}
Check For File Annotation ${fileName}

# Now select both Screens...
Meta Click Node ${nodeId}
Wait Until Page Contains Element id=batch_ann_title
# Remove first File Annotation
Remove File Annotation ${fileName}
Select Screen By Id ${sId_One}
Check File Annotation Gone ${fileName}
Select Screen By Id ${sId_Two}
Check File Annotation Gone ${fileName}

Delete Container
Select Screen By Id ${sId_One}
Delete Container

# Test Rating

Test Search Results File Annotations

Select Experimenter
${sId_One}= Create Screen robot file annotations_1

# Annotate single Screen
Add File Annotation ${fileNameTwo}

Input Text id=id_search_query ${fileNameTwo}
Submit Form
Location Should Be ${SEARCH URL}

Wait Until Page Contains Element xpath=//img[contains(@alt, 'plate')]
Click Element xpath=//img[contains(@alt, 'plate')]
Wait Until Page Contains Element //*[@id="general_tab"]//th[contains(text(), 'Plate ID:')]

#Minimal checking to check if you can add Annotations on the search result page
Click Element xpath=//h1[@data-name='attachments']
Check For File Annotation ${fileNameTwo}
Remove File Annotation ${fileNameTwo}
Add File Annotation ${fileNameTwo}
Click Element xpath=//h1[@data-name='comments']
Add Comment ${commentText}

Go To ${WELCOME URL}
Select Experimenter
Select Screen By Id ${sId_One}
Delete Container




19 changes: 11 additions & 8 deletions components/tests/ui/testcases/web/center_right_panel_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,25 @@ Wait Until Right Panel Loads For MultiSelection
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/button[contains(@title, 'Download Image as...')]
Wait Until Element Is Visible xpath=//*[@id="show_link_btn"]/span

Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h2[contains(text(), 'Annotations')]
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Attachments')]
Wait Until Element Is Visible xpath=//*[@id="annotationFilter"]

Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h2[contains(text(), 'Rating')]
Wait Until Element Is Visible xpath=//*[@id="add_rating"]/span
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Ratings')]
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Ratings')]
Wait Until Element Is Visible xpath=//*[@id="rating_annotations"]

Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h2[contains(text(), 'Tags')]
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Tags')]
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Tags')]
Wait Until Element Is Visible xpath=//*[@id="launch_tags_form"]/span

Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h2[contains(text(), 'Attach')]
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/input[contains(@title, 'Select Files for Scripts')]
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Attachments')]
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Attachments')]
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/input[contains(@title, 'Select files for scripts')]
Wait Until Element Is Visible xpath=//*[@id="choose_file_anns"]/span

Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h2[contains(text(), 'Comment')]
Wait Until Element Is Visible xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Comments')]
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Comments')]
Wait Until Element Is Visible xpath=//*[@id="id_comment"]
Wait Until Element Is Visible xpath=//*[@id="add_comment_form"]//td/input[contains(@value, 'Add Comment')]

Element Should Not Be Visible xpath=//*[@id="general_tab"]

Expand Down
8 changes: 7 additions & 1 deletion components/tests/ui/testcases/web/forms_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,15 @@ Test Batch Annotate
Wait Until Page Contains Element id=batch_ann_title

# Comment Form
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Comments')]
Wait Until Element Is Visible id=id_comment
Input Text comment test add comment
Click Button Add Comment
Submit Form add_comment_form
Wait Until Page Contains test add comment

# Tags
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Tags')]
Wait Until Element Is Visible id=launch_tags_form
Click Element launch_tags_form
Wait Until Page Contains Element id_tag
# Wait for tag panel being loded
Expand All @@ -160,6 +164,8 @@ Test Batch Annotate
Wait Until Page Contains Element xpath=//div[@class='tag']/a[contains(text(), testSeleniumTag${pid})] ${WAIT}

# Files
Click Element xpath=//*[@id="metadata_general"]//div/h1[contains(text(), 'Attachments')]
Wait Until Element Is Visible id=choose_file_anns
Click Element choose_file_anns
Wait Until Page Contains Element id_files
Click Element xpath=//select[@id='id_files']/option # just pick first file
Expand Down
2 changes: 1 addition & 1 deletion components/tests/ui/testcases/web/map_annotations_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Test Map Annotation
Wait Until Page Contains Element css=div.mapAnnContainer
Click Element xpath=//h1[@data-name='keyvaluepairs']
# No rows selected. Toolbar should allow 'Insert' only.
Xpath Should Not Have Class xpath=//ul[contains(@class, 'mapAnnToolbar')]//input[@title='Insert rows'] button-disabled
Xpath Should Have Class xpath=//ul[contains(@class, 'mapAnnToolbar')]//input[@title='Insert row'] button-disabled
Xpath Should Have Class xpath=//ul[contains(@class, 'mapAnnToolbar')]//input[@title='Copy rows'] button-disabled
Xpath Should Have Class xpath=//ul[contains(@class, 'mapAnnToolbar')]//input[@title='Paste rows'] button-disabled
Xpath Should Have Class xpath=//ul[contains(@class, 'mapAnnToolbar')]//input[@title='Delete rows'] button-disabled
Expand Down
2 changes: 1 addition & 1 deletion components/tests/ui/testcases/web/search.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ${XpathProjectThumb} xpath=//table[@id='dataTable']//img[contains(@src,'folde
${XpathPlate} xpath=//table[@id='dataTable']//img[@alt='plate']
${XpathPlateThumb} xpath=//table[@id='dataTable']//img[contains(@src,'folder_plate16.png')]
${XpathScreen} xpath=//table[@id='dataTable']//img[@alt='screen']
${XpathScreenValid} xpath=//table[@id='dataTable']//img[contains(@src,'folder_screen16.png')]
${XpathScreenThumb} xpath=//table[@id='dataTable']//img[contains(@src,'folder_screen16.png')]
${XpathTable} xpath=//table[@id='dataTable']
${XpathTableColumn} xpath=//table[@id='dataTable']//tr/td[position()=3]
${XPathAlertText} xpath=//div[contains(@class,'ui-dialog')][contains(@style,'display: block')]//p
Expand Down

0 comments on commit 44642c4

Please sign in to comment.