@@ -99,15 +99,17 @@ export class CheckoutPage {
99
99
await this [ method ] ( email , password , register , screenshots )
100
100
}
101
101
102
- async checkoutDefault ( email , password = false , register = false , screenshots = [ ] ) {
102
+ async checkoutDefault ( email = false , password = false , register = false , screenshots = [ ] ) {
103
103
await this . gotoCheckout ( )
104
104
105
105
if ( screenshots . includes ( 'login' ) ) {
106
106
await expect ( this . page ) . toHaveScreenshot ( { fullPage : true } )
107
107
}
108
108
109
- await this . login ( email , password , register )
110
- await this . continue ( 'credentials' )
109
+ if ( email ) {
110
+ await this . login ( email , password , register )
111
+ await this . continue ( 'credentials' )
112
+ }
111
113
112
114
if ( screenshots . includes ( 'credentials' ) ) {
113
115
await expect ( this . page ) . toHaveScreenshot ( { fullPage : true } )
@@ -133,14 +135,17 @@ export class CheckoutPage {
133
135
}
134
136
}
135
137
136
- async checkoutOnestep ( email , password = false , register = false , screenshots = [ ] ) {
138
+ async checkoutOnestep ( email = false , password = false , register = false , screenshots = [ ] ) {
137
139
await this . gotoCheckout ( )
138
140
139
141
if ( screenshots . includes ( 'login' ) ) {
140
142
await expect ( this . page ) . toHaveScreenshot ( { fullPage : true } )
141
143
}
142
144
143
- await this . login ( email , password , register )
145
+ if ( email ) {
146
+ await this . login ( email , password , register )
147
+ }
148
+
144
149
await this . shippingAddress ( )
145
150
await this . shippingMethod ( )
146
151
await this . paymentMethod ( )
0 commit comments