Skip to content

Commit

Permalink
add robot test
Browse files Browse the repository at this point in the history
  • Loading branch information
1letter committed Oct 16, 2024
1 parent f26a700 commit 5fff65d
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 105 deletions.
78 changes: 78 additions & 0 deletions src/collective/taxonomy/tests/robot/test_taxonomy.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
*** Settings ***

Resource plone/app/robotframework/browser.robot

Library Remote ${PLONE_URL}/RobotRemote
Library Collections

Test Setup Run Keywords Plone test setup
Test Teardown Run keywords Plone test teardown


*** Variables ***

${TITLE} An edited page
${PAGE_ID} an-edited-page


*** Test Cases ***

Scenario: As a manager I can add a taxonomy
Given a logged in manager
and an page type with a taxonomy
When I edit the page
and I select multiple options
Then I see '2' selected options

When I save the page
and I edit the page
and I deselect option 'Information Science'
Then I see '1' selected options

*** Keywords ***

# Given

a logged in manager
Enable autologin as Manager

an page type with a taxonomy
Create content
... type=Document
... title=${TITLE}

Go to ${PLONE_URL}/dexterity-types/Document/@@behaviors
Check Checkbox //input[@name="form.widgets.collective.taxonomy.generated.test:list"]
Click //button[@name="form.buttons.apply"]
Wait For Condition Text //body contains Behaviors successfully updated.

# When
I edit the page
Go to ${PLONE_URL}/${PAGE_ID}/edit
Get Text //body contains Edit Page

I select multiple options
Select Options By //select[@name="form.widgets.test.taxonomy_test.from"] index 0 2
Click //button[@name="from2toButton"]

I save the page
Click //button[@name="form.buttons.save"]
Wait For Condition Text //body contains Changes saved

I deselect option '${label}'
Select Options By //select[@name="form.widgets.test.taxonomy_test.to"] label ${label}
Click //button[@name="to2fromButton"]

# Then
I see '${count}' selected options
Get Element Count //select[@name="form.widgets.test.taxonomy_test.to"]/option should be ${count}

# Misc

Pause
[Documentation] Visually pause test execution with interactive dialog by
... importing **Dialogs**-library and calling its
... **Pause Execution**-keyword.
Import library Dialogs
Pause execution

105 changes: 0 additions & 105 deletions src/collective/taxonomy/tests/robot/todo_test_taxonomy.robot

This file was deleted.

0 comments on commit 5fff65d

Please sign in to comment.