@@ -70,8 +70,13 @@ public function processAssert(
70
70
71
71
$ pageCustomerIndex ->open ();
72
72
$ pageCustomerIndex ->getCustomerGridBlock ()->searchAndOpen ($ filter );
73
+
74
+ /** @var \Magento\Mtf\System\Event\EventManagerInterface $eventManager */
75
+ $ eventManager = $ this ->objectManager ->get ('Magento\Mtf\System\Event\EventManagerInterface ' );
76
+ $ eventManager ->dispatchEvent (['exception ' ], [var_export ($ data , true )]);
77
+
73
78
$ dataForm = $ pageCustomerIndexEdit ->getCustomerForm ()->getDataCustomer ($ customer , $ address );
74
- $ dataDiff = $ this ->verify ($ data , $ dataForm );;
79
+ $ dataDiff = $ this ->verify ($ data , $ dataForm );
75
80
\PHPUnit_Framework_Assert::assertTrue (
76
81
empty ($ dataDiff ),
77
82
'Customer data on edit page(backend) not equals to passed from fixture. '
@@ -95,17 +100,22 @@ protected function verify(array $dataFixture, array $dataForm)
95
100
if (in_array ($ name , $ this ->customerSkippedFields )) {
96
101
continue ;
97
102
}
98
- if (!isset ($ dataForm ['customer ' ][$ name ])) {
99
- $ msg = print_r ($ dataFixture , true ) . print_r ($ dataForm , true );;
100
- throw new \Exception ('Testmsg ' . $ msg . ' Testmsg ' );
103
+ if (isset ($ dataForm ['customer ' ][$ name ])) {
104
+ $ result [] = "\ncustomer {$ name }: \"{$ dataForm ['customer ' ][$ name ]}\" instead of \"{$ value }\"" ;
105
+ } else {
106
+ $ result [] = "\ncustomer {$ name }: Field is absent. Expected value \"{$ value }\"" ;
101
107
}
102
- $ result [] = "\ncustomer {$ name }: \"{$ dataForm ['customer ' ][$ name ]}\" instead of \"{$ value }\"" ;
103
108
}
104
109
foreach ($ dataFixture ['addresses ' ] as $ key => $ address ) {
105
110
$ addressDiff = array_diff ($ address , $ dataForm ['addresses ' ][$ key ]);
106
111
foreach ($ addressDiff as $ name => $ value ) {
107
- $ result [] = "\naddress # {$ key } {$ name }: \"{$ dataForm ['addresses ' ][$ key ][$ name ]}"
108
- . "\" instead of \"{$ value }\"" ;
112
+ if (isset ($ dataForm ['addresses ' ][$ key ][$ name ])) {
113
+ $ result [] = "\naddress # {$ key } {$ name }: \"{$ dataForm ['addresses ' ][$ key ][$ name ]}"
114
+ . "\" instead of \"{$ value }\"" ;
115
+ } else {
116
+ $ result [] = "\naddress # {$ key } {$ name }: Field absent. Expected value \"{$ value }\"" ;
117
+ }
118
+
109
119
}
110
120
}
111
121
0 commit comments