fix: change way of locating order status (#1752)

This commit is contained in:
Radosław Szpiech 2022-10-14 17:18:08 +02:00 committed by GitHub
parent 8ecb4430cc
commit ecb19f226b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,11 +153,10 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
id: orderId, id: orderId,
status: OrderStatus.STATUS_ACTIVE, status: OrderStatus.STATUS_ACTIVE,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible') 'have.text',
.within(() => { 'Active'
cy.get(`[col-id=${orderStatus}]`).should('have.text', 'Active'); );
});
}); });
it('must see an expired order', () => { it('must see an expired order', () => {
@ -166,11 +165,10 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
id: orderId, id: orderId,
status: OrderStatus.STATUS_EXPIRED, status: OrderStatus.STATUS_EXPIRED,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible') 'have.text',
.within(() => { 'Expired'
cy.get(`[col-id=${orderStatus}]`).should('have.text', 'Expired'); );
});
}); });
it('must see a cancelled order', () => { it('must see a cancelled order', () => {
@ -180,11 +178,10 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
id: orderId, id: orderId,
status: OrderStatus.STATUS_CANCELLED, status: OrderStatus.STATUS_CANCELLED,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible') 'have.text',
.within(() => { 'Cancelled'
cy.get(`[col-id=${orderStatus}]`).should('have.text', 'Cancelled'); );
});
}); });
it('must see a stopped order', () => { it('must see a stopped order', () => {
@ -194,11 +191,10 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
id: orderId, id: orderId,
status: OrderStatus.STATUS_STOPPED, status: OrderStatus.STATUS_STOPPED,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible') 'have.text',
.within(() => { 'Stopped'
cy.get(`[col-id=${orderStatus}]`).should('have.text', 'Stopped'); );
});
}); });
it('must see a partially filled order', () => { it('must see a partially filled order', () => {
@ -209,15 +205,14 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
size: '5', size: '5',
remaining: '1', remaining: '1',
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible')
.within(() => {
cy.get(`[col-id=${orderStatus}]`).should(
'have.text', 'have.text',
'PartiallyFilled' 'PartiallyFilled'
); );
cy.get(`[col-id=${orderRemaining}]`).should('have.text', '4/5'); cy.get(`[row-id=${orderId}] [col-id=${orderRemaining}]`).should(
}); 'have.text',
'4/5'
);
}); });
it('must see a filled order', () => { it('must see a filled order', () => {
@ -227,11 +222,10 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
id: orderId, id: orderId,
status: OrderStatus.STATUS_FILLED, status: OrderStatus.STATUS_FILLED,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible') 'have.text',
.within(() => { 'Filled'
cy.get(`[col-id=${orderStatus}]`).should('have.text', 'Filled'); );
});
}); });
it('must see a rejected order', () => { it('must see a rejected order', () => {
@ -241,15 +235,11 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
status: OrderStatus.STATUS_REJECTED, status: OrderStatus.STATUS_REJECTED,
rejectionReason: OrderRejectionReason.ORDER_ERROR_INTERNAL_ERROR, rejectionReason: OrderRejectionReason.ORDER_ERROR_INTERNAL_ERROR,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible')
.within(() => {
cy.get(`[col-id=${orderStatus}]`).should(
'have.text', 'have.text',
'Rejected: Internal error' 'Rejected: Internal error'
); );
}); });
});
it('must see a parked order', () => { it('must see a parked order', () => {
// 7002-SORD-048 // 7002-SORD-048
@ -258,10 +248,9 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
id: orderId, id: orderId,
status: OrderStatus.STATUS_PARKED, status: OrderStatus.STATUS_PARKED,
}); });
cy.get(`[row-id=${orderId}]`) cy.get(`[row-id=${orderId}] [col-id=${orderStatus}]`).should(
.should('be.visible') 'have.text',
.within(() => { 'Parked'
cy.get(`[col-id=${orderStatus}]`).should('have.text', 'Parked'); );
});
}); });
}); });