Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBPIH-6882: Fix for Export all items empty db case #30

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

kkrawczyk123
Copy link
Collaborator

@kkrawczyk123 kkrawczyk123 changed the title Fix for Export all items emtpydb case Fix for Export all items emtpy db case Jan 8, 2025
@kkrawczyk123 kkrawczyk123 changed the title Fix for Export all items emtpy db case Fix for Export all items empty db case Jan 8, 2025
await createInboundPage.addItemsStep.isLoaded();
await createInboundPage.wizzardSteps.assertActiveStep('Add items');

INBOUND2_ID = createInboundPage.getId();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to declare the INBOUND2_ID as a let? I don't see you are overriding this value, but maybe I am missing something

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it'd need to be initialized in a different place, so I guess it is fine. Plus I see this is done like that in other places as well.

Comment on lines 58 to 61
const ifInboundListPageIsEmpty =
await inboundListPage.table.emptyInboundList.isVisible();
const ifInboundListPageIsNotEmpty =
await inboundListPage.table.emptyInboundList.isHidden();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need both ifInboundListPageIsEmpty and ifInboundListPageIsNotEmpty?
For me, it looks like:
ifInboundListPageIsEmpty == !ifInboundListPageIsNotEmpty

@kkrawczyk123 kkrawczyk123 changed the title Fix for Export all items empty db case OBPIH-6882: Fix for Export all items empty db case Jan 9, 2025
Copy link
Contributor

@awalkowiak awalkowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beside the one that I mentioned there are more code duplications. Is it possible to improve the code to get rid of the other duplications as well?

}

if (ifInboundListPageIsNotEmpty) {
await test.step('Go to create stock movement', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything in this if is a duplication of the part from lines 98-145. Can you just move this part out of the if above and remove this one? Or is there any kind of difference there?

await createInboundPage.addItemsStep.isLoaded();
await createInboundPage.wizzardSteps.assertActiveStep('Add items');

INBOUND2_ID = createInboundPage.getId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise it'd need to be initialized in a different place, so I guess it is fine. Plus I see this is done like that in other places as well.

@awalkowiak awalkowiak merged commit ee9272d into main Jan 13, 2025
1 check passed
@awalkowiak awalkowiak deleted the export-all-items-emtpydb-case branch January 13, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants