@@ -5,143 +5,143 @@ describe('PO Button Labs Sample', () => {
55
66 describe ( 'Estado inicial' , ( ) => {
77 it ( 'deve renderizar o botão principal' , ( ) => {
8- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'be.visible' ) ;
8+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'be.visible' ) ;
99 } ) ;
1010
1111 it ( 'deve iniciar com kind secondary' , ( ) => {
12- cy . get ( 'app -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'secondary' ) ;
12+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'secondary' ) ;
1313 } ) ;
1414
1515 it ( 'deve renderizar o formulário de configuração' , ( ) => {
16- cy . get ( 'app -button-labs form' ) . should ( 'exist' ) ;
16+ cy . get ( 'sample-po -button-labs form' ) . should ( 'exist' ) ;
1717 } ) ;
1818
1919 it ( 'deve exibir o campo de input para Label' , ( ) => {
20- cy . get ( 'app -button-labs po-input' ) . should ( 'exist' ) ;
20+ cy . get ( 'sample-po -button-labs po-input' ) . should ( 'exist' ) ;
2121 } ) ;
2222
2323 it ( 'deve exibir o checkbox group de Properties' , ( ) => {
24- cy . get ( 'app -button-labs po-checkbox-group' ) . should ( 'exist' ) ;
24+ cy . get ( 'sample-po -button-labs po-checkbox-group' ) . should ( 'exist' ) ;
2525 } ) ;
2626
2727 it ( 'deve exibir os radio groups de configuração' , ( ) => {
28- cy . get ( 'app -button-labs po-radio-group' ) . should ( 'have.length' , 4 ) ;
28+ cy . get ( 'sample-po -button-labs po-radio-group' ) . should ( 'have.length' , 4 ) ;
2929 } ) ;
3030
3131 it ( 'deve exibir o botão Sample Restore' , ( ) => {
32- cy . get ( 'app -button-labs po-button' ) . last ( ) . find ( '.po-button-label' ) . should ( 'contain.text' , 'Sample Restore' ) ;
32+ cy . get ( 'sample-po -button-labs po-button' ) . last ( ) . find ( '.po-button-label' ) . should ( 'contain.text' , 'Sample Restore' ) ;
3333 } ) ;
3434 } ) ;
3535
3636 describe ( 'Alteração de Label' , ( ) => {
3737 it ( 'deve atualizar o label do botão ao digitar no campo Label' , ( ) => {
38- cy . get ( 'app -button-labs po-input input' ) . clear ( ) . type ( 'Meu Botão' ) ;
39- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( '.po-button-label' ) . should ( 'contain.text' , 'Meu Botão' ) ;
38+ cy . get ( 'sample-po -button-labs po-input input' ) . clear ( ) . type ( 'Meu Botão' ) ;
39+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( '.po-button-label' ) . should ( 'contain.text' , 'Meu Botão' ) ;
4040 } ) ;
4141 } ) ;
4242
4343 describe ( 'Propriedade Disabled' , ( ) => {
4444 it ( 'deve desabilitar o botão ao marcar a opção Disabled' , ( ) => {
45- cy . get ( 'app -button-labs po-checkbox-group' ) . contains ( 'Disabled' ) . click ( ) ;
46- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'be.disabled' ) ;
45+ cy . get ( 'sample-po -button-labs po-checkbox-group' ) . contains ( 'Disabled' ) . click ( ) ;
46+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'be.disabled' ) ;
4747 } ) ;
4848 } ) ;
4949
5050 describe ( 'Propriedade Loading' , ( ) => {
5151 it ( 'deve exibir o ícone de loading ao marcar a opção Loading' , ( ) => {
52- cy . get ( 'app -button-labs po-checkbox-group' ) . contains ( 'Loading' ) . click ( ) ;
53- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'be.disabled' ) ;
54- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( '.po-button-loading-icon' ) . should ( 'exist' ) ;
52+ cy . get ( 'sample-po -button-labs po-checkbox-group' ) . contains ( 'Loading' ) . click ( ) ;
53+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'be.disabled' ) ;
54+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( '.po-button-loading-icon' ) . should ( 'exist' ) ;
5555 } ) ;
5656 } ) ;
5757
5858 describe ( 'Propriedade Danger' , ( ) => {
5959 it ( 'deve aplicar o atributo danger ao marcar a opção Danger' , ( ) => {
60- cy . get ( 'app -button-labs po-checkbox-group' ) . contains ( 'Danger' ) . click ( ) ;
61- cy . get ( 'app -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-danger' , 'true' ) ;
60+ cy . get ( 'sample-po -button-labs po-checkbox-group' ) . contains ( 'Danger' ) . click ( ) ;
61+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-danger' , 'true' ) ;
6262 } ) ;
6363 } ) ;
6464
6565 describe ( 'Alteração de Icon' , ( ) => {
6666 it ( 'deve aplicar o ícone an an-newspaper ao botão' , ( ) => {
67- cy . get ( 'app -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-newspaper' ) . click ( ) ;
68- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'po-icon.po-button-icon' ) . should ( 'exist' ) ;
69- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'po-icon i.an-newspaper' ) . should ( 'exist' ) ;
67+ cy . get ( 'sample-po -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-newspaper' ) . click ( ) ;
68+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'po-icon.po-button-icon' ) . should ( 'exist' ) ;
69+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'po-icon i.an-newspaper' ) . should ( 'exist' ) ;
7070 } ) ;
7171
7272 it ( 'deve aplicar o ícone an an-calendar-dots ao botão' , ( ) => {
73- cy . get ( 'app -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-calendar-dots' ) . click ( ) ;
74- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'po-icon i.an-calendar-dots' ) . should ( 'exist' ) ;
73+ cy . get ( 'sample-po -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-calendar-dots' ) . click ( ) ;
74+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'po-icon i.an-calendar-dots' ) . should ( 'exist' ) ;
7575 } ) ;
7676
7777 it ( 'deve aplicar o ícone an an-user ao botão' , ( ) => {
78- cy . get ( 'app -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-user' ) . click ( ) ;
79- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'po-icon i.an-user' ) . should ( 'exist' ) ;
78+ cy . get ( 'sample-po -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-user' ) . click ( ) ;
79+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'po-icon i.an-user' ) . should ( 'exist' ) ;
8080 } ) ;
8181
8282 it ( 'deve aplicar o ícone fa fa-podcast ao botão' , ( ) => {
83- cy . get ( 'app -button-labs po-radio-group[name="icon"]' ) . contains ( 'fa fa-podcast' ) . click ( ) ;
84- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'po-icon i.fa-podcast' ) . should ( 'exist' ) ;
83+ cy . get ( 'sample-po -button-labs po-radio-group[name="icon"]' ) . contains ( 'fa fa-podcast' ) . click ( ) ;
84+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'po-icon i.fa-podcast' ) . should ( 'exist' ) ;
8585 } ) ;
8686 } ) ;
8787
8888 describe ( 'Alteração de Kind' , ( ) => {
8989 it ( 'deve alterar o kind para primary' , ( ) => {
90- cy . get ( 'app -button-labs po-radio-group[name="kind"]' ) . contains ( 'primary' ) . click ( ) ;
91- cy . get ( 'app -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'primary' ) ;
90+ cy . get ( 'sample-po -button-labs po-radio-group[name="kind"]' ) . contains ( 'primary' ) . click ( ) ;
91+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'primary' ) ;
9292 } ) ;
9393
9494 it ( 'deve alterar o kind para tertiary' , ( ) => {
95- cy . get ( 'app -button-labs po-radio-group[name="kind"]' ) . contains ( 'tertiary' ) . click ( ) ;
96- cy . get ( 'app -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'tertiary' ) ;
95+ cy . get ( 'sample-po -button-labs po-radio-group[name="kind"]' ) . contains ( 'tertiary' ) . click ( ) ;
96+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'tertiary' ) ;
9797 } ) ;
9898 } ) ;
9999
100100 describe ( 'Alteração de Type' , ( ) => {
101101 it ( 'deve alterar o type para submit' , ( ) => {
102- cy . get ( 'app -button-labs po-radio-group[name="type"]' ) . contains ( 'submit' ) . click ( ) ;
103- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.attr' , 'type' , 'submit' ) ;
102+ cy . get ( 'sample-po -button-labs po-radio-group[name="type"]' ) . contains ( 'submit' ) . click ( ) ;
103+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.attr' , 'type' , 'submit' ) ;
104104 } ) ;
105105
106106 it ( 'deve alterar o type para reset' , ( ) => {
107- cy . get ( 'app -button-labs po-radio-group[name="type"]' ) . contains ( 'reset' ) . click ( ) ;
108- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.attr' , 'type' , 'reset' ) ;
107+ cy . get ( 'sample-po -button-labs po-radio-group[name="type"]' ) . contains ( 'reset' ) . click ( ) ;
108+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.attr' , 'type' , 'reset' ) ;
109109 } ) ;
110110 } ) ;
111111
112112 describe ( 'Alteração de Size' , ( ) => {
113113 it ( 'deve alterar o tamanho para large' , ( ) => {
114- cy . get ( 'app -button-labs po-radio-group[name="size"]' ) . contains ( 'large' ) . click ( ) ;
115- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.class' , 'po-button-large' ) ;
114+ cy . get ( 'sample-po -button-labs po-radio-group[name="size"]' ) . contains ( 'large' ) . click ( ) ;
115+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.class' , 'po-button-large' ) ;
116116 } ) ;
117117
118118 it ( 'deve alterar o tamanho de large para medium' , ( ) => {
119119 // Muda para large primeiro
120- cy . get ( 'app -button-labs po-radio-group[name="size"]' ) . contains ( 'large' ) . click ( ) ;
121- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.class' , 'po-button-large' ) ;
120+ cy . get ( 'sample-po -button-labs po-radio-group[name="size"]' ) . contains ( 'large' ) . click ( ) ;
121+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'have.class' , 'po-button-large' ) ;
122122
123123 // Volta para medium
124- cy . get ( 'app -button-labs po-radio-group[name="size"]' ) . contains ( 'medium' ) . click ( ) ;
125- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'not.have.class' , 'po-button-large' ) ;
124+ cy . get ( 'sample-po -button-labs po-radio-group[name="size"]' ) . contains ( 'medium' ) . click ( ) ;
125+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'not.have.class' , 'po-button-large' ) ;
126126 } ) ;
127127 } ) ;
128128
129129 describe ( 'Interação Danger e Kind Tertiary' , ( ) => {
130130 it ( 'deve desabilitar a opção Danger ao selecionar kind tertiary' , ( ) => {
131- cy . get ( 'app -button-labs po-radio-group[name="kind"]' ) . contains ( 'tertiary' ) . click ( ) ;
131+ cy . get ( 'sample-po -button-labs po-radio-group[name="kind"]' ) . contains ( 'tertiary' ) . click ( ) ;
132132 // Quando kind é tertiary, a opção Danger fica desabilitada
133- cy . get ( 'app -button-labs po-checkbox-group po-checkbox' ) . last ( ) . find ( 'span.po-checkbox' ) . should ( 'have.attr' , 'aria-disabled' , 'true' ) ;
133+ cy . get ( 'sample-po -button-labs po-checkbox-group po-checkbox' ) . last ( ) . find ( 'span.po-checkbox' ) . should ( 'have.attr' , 'aria-disabled' , 'true' ) ;
134134 } ) ;
135135
136136 it ( 'deve desabilitar a opção tertiary ao marcar Danger' , ( ) => {
137- cy . get ( 'app -button-labs po-checkbox-group' ) . contains ( 'Danger' ) . click ( ) ;
138- cy . get ( 'app -button-labs po-radio-group[name="kind"]' ) . find ( 'po-radio' ) . last ( ) . find ( 'input' ) . should ( 'be.disabled' ) ;
137+ cy . get ( 'sample-po -button-labs po-checkbox-group' ) . contains ( 'Danger' ) . click ( ) ;
138+ cy . get ( 'sample-po -button-labs po-radio-group[name="kind"]' ) . find ( 'po-radio' ) . last ( ) . find ( 'input' ) . should ( 'be.disabled' ) ;
139139 } ) ;
140140 } ) ;
141141
142142 describe ( 'Botão Click' , ( ) => {
143143 it ( 'deve exibir um diálogo ao clicar no botão principal' , ( ) => {
144- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . click ( ) ;
144+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . click ( ) ;
145145 cy . get ( 'po-modal' ) . should ( 'be.visible' ) ;
146146 cy . get ( 'po-modal' ) . should ( 'contain.text' , 'Hello PO World!!!' ) ;
147147 } ) ;
@@ -150,20 +150,20 @@ describe('PO Button Labs Sample', () => {
150150 describe ( 'Restore' , ( ) => {
151151 it ( 'deve restaurar o estado inicial completo ao clicar em Sample Restore' , ( ) => {
152152 // Altera várias propriedades
153- cy . get ( 'app -button-labs po-input input' ) . clear ( ) . type ( 'Teste' ) ;
154- cy . get ( 'app -button-labs po-radio-group[name="kind"]' ) . contains ( 'primary' ) . click ( ) ;
155- cy . get ( 'app -button-labs po-radio-group[name="size"]' ) . contains ( 'large' ) . click ( ) ;
156- cy . get ( 'app -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-user' ) . click ( ) ;
157- cy . get ( 'app -button-labs po-checkbox-group' ) . contains ( 'Disabled' ) . click ( ) ;
153+ cy . get ( 'sample-po -button-labs po-input input' ) . clear ( ) . type ( 'Teste' ) ;
154+ cy . get ( 'sample-po -button-labs po-radio-group[name="kind"]' ) . contains ( 'primary' ) . click ( ) ;
155+ cy . get ( 'sample-po -button-labs po-radio-group[name="size"]' ) . contains ( 'large' ) . click ( ) ;
156+ cy . get ( 'sample-po -button-labs po-radio-group[name="icon"]' ) . contains ( 'an an-user' ) . click ( ) ;
157+ cy . get ( 'sample-po -button-labs po-checkbox-group' ) . contains ( 'Disabled' ) . click ( ) ;
158158
159159 // Clica em restaurar
160- cy . get ( 'app -button-labs po-button' ) . last ( ) . find ( 'button.po-button' ) . click ( ) ;
160+ cy . get ( 'sample-po -button-labs po-button' ) . last ( ) . find ( 'button.po-button' ) . click ( ) ;
161161
162162 // Verifica que tudo voltou ao estado inicial
163- cy . get ( 'app -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'secondary' ) ;
164- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'not.be.disabled' ) ;
165- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'not.have.class' , 'po-button-large' ) ;
166- cy . get ( 'app -button-labs po-button' ) . first ( ) . find ( 'po-icon' ) . should ( 'not.exist' ) ;
163+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . should ( 'have.attr' , 'p-kind' , 'secondary' ) ;
164+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'not.be.disabled' ) ;
165+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'button.po-button' ) . should ( 'not.have.class' , 'po-button-large' ) ;
166+ cy . get ( 'sample-po -button-labs po-button' ) . first ( ) . find ( 'po-icon' ) . should ( 'not.exist' ) ;
167167 } ) ;
168168 } ) ;
169169} ) ;
0 commit comments