Ignore:
Timestamp:
09/02/11 14:27:19 (13 years ago)
Author:
luiz-fernando
Message:

Ticket #1771 - Adicionado testes automatizados para modulo da agenda

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/testlink/automation2.0/src/test/java/org/expressolivre/cte/pages/calendar/AgendaPermissionPage.java

    r4962 r5025  
    11package org.expressolivre.cte.pages.calendar; 
    22 
     3import java.util.List; 
    34import java.util.Set; 
    45 
     
    6061 
    6162        /** 
     63         * Verifica se o usuario ja esta na lista de permissoes. 
     64         *  
     65         * @param userName 
     66         * @return 
     67         */ 
     68        public Boolean isUserInList(String userName) { 
     69                return super.isValueInCombo(this.userList, userName, true); 
     70        } 
     71 
     72        /** 
     73         * Remove todos os usuarios do compartilhamento. 
     74         */ 
     75        public void removeAllUsers() { 
     76                List<WebElement> users = super.getComboElements(this.userList); 
     77                for (WebElement user : users) { 
     78                        user.setSelected(); 
     79                        this.removeButton.click(); 
     80                } 
     81        } 
     82 
     83        /** 
    6284         * Adaptacao da solucao para lidar com janelas popups obtida em <a 
    6385         * href="http://groups.google.com/group 
     
    92114        } 
    93115 
    94         public void setReadPermission() { 
    95                 this.read.click(); 
     116        public void setReadPermission(boolean read) { 
     117                if (read && !this.read.isSelected()) { 
     118                        this.read.click(); 
     119                } else if (!read && this.read.isSelected()) { 
     120                        this.read.click(); 
     121                } 
     122        } 
     123 
     124        public void setEditPermission(boolean edit) { 
     125                if (edit && !this.edit.isSelected()) { 
     126                        this.edit.click(); 
     127                } else if (!edit && this.edit.isSelected()) { 
     128                        this.edit.click(); 
     129                } 
     130        } 
     131 
     132        public void setAddPermission(boolean add) { 
     133                if (add && !this.add.isSelected()) { 
     134                        this.add.click(); 
     135                } else if (!add && this.add.isSelected()) { 
     136                        this.add.click(); 
     137                } 
     138        } 
     139 
     140        public void setRemovePermission(boolean remove) { 
     141                if (remove && !this.remove.isSelected()) { 
     142                        this.remove.click(); 
     143                } else if (!remove && this.remove.isSelected()) { 
     144                        this.remove.click(); 
     145                } 
     146        } 
     147 
     148        public void setRestrictPermission(boolean restrict) { 
     149                if (restrict && !this.restrict.isSelected()) { 
     150                        this.restrict.click(); 
     151                } else if (!restrict && this.restrict.isSelected()) { 
     152                        this.restrict.click(); 
     153                } 
     154        } 
     155 
     156        public void clearPemissions() { 
     157                this.setReadPermission(false); 
     158                this.setEditPermission(false); 
     159                this.setRemovePermission(false); 
     160                this.setAddPermission(false); 
     161                this.setRestrictPermission(false); 
    96162        } 
    97163 
     
    99165                this.cancelButton.click(); 
    100166        } 
     167 
     168        public void apply() { 
     169                this.okButton.click(); 
     170        } 
    101171} 
Note: See TracChangeset for help on using the changeset viewer.