<commit_before>context('List View', () => {
	before(() => {
		cy.login();
		cy.visit('/app/website');
		return cy.window().its('frappe').then(frappe => {
			return frappe.xcall("frappe.tests.ui_test_helpers.setup_workflow");
		});
	});

	it('Keep checkbox checked after Bulk Update', () => {
		cy.go_to_list('ToDo');
		cy.get('.list-row-container .list-row-checkbox').click({ multiple: true, force: true });
		cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
		cy.get('.dropdown-menu li:visible .dropdown-item .menu-item-label[data-label="Edit"]').click();

		cy.get('.modal-body .form-control[data-fieldname="field"]').first().select('Due Date').wait(200);
		cy.fill_field('value', '09-28-21', 'Date');

		cy.get('.modal-footer .standard-actions .btn-primary').click();
		cy.wait(500);

		cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
		cy.get('.list-row-container .list-row-checkbox:checked').should('be.visible');
	});

	it('enables "Actions" button', () => {
		const actions = ['Approve', 'Reject', 'Edit', 'Export', 'Assign To', 'Apply Assignment Rule', 'Add Tags', 'Print', 'Delete'];
		cy.go_to_list('ToDo');
		cy.get('.list-row-container:contains("Pending") .list-row-checkbox').click({ multiple: true, force: true });
		cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
		cy.get('.dropdown-menu li:visible .dropdown-item').should('have.length', 9).each((el, index) => {
			cy.wrap(el).contains(actions[index]);
		}).then((elements) => {
			cy.intercept({
				method: 'POST',
				url: 'api/method/frappe.model.workflow.bulk_workflow_approval'
			}).as('bulk-approval');
			cy.intercept({
				method: 'POST',
				url: 'api/method/frappe.desk.reportview.get'
			}).as('real-time-update');
			cy.wrap(elements).contains('Approve').click();
			cy.wait(['@bulk-approval', '@real-time-update']);
			cy.hide_dialog();
			cy.clear_filters();
			cy.get('.list-row-container:visible').should('contain', 'Approved');
		});
	});
});<commit_msg>test: Fix flaky test 'enables Actions button'<commit_after>context('List View', () => {
	before(() => {
		cy.login();
		cy.visit('/app/website');
		return cy.window().its('frappe').then(frappe => {
			return frappe.xcall("frappe.tests.ui_test_helpers.setup_workflow");
		});
	});

	it('Keep checkbox checked after Bulk Update', () => {
		cy.go_to_list('ToDo');
		cy.get('.list-row-container .list-row-checkbox').click({ multiple: true, force: true });
		cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
		cy.get('.dropdown-menu li:visible .dropdown-item .menu-item-label[data-label="Edit"]').click();

		cy.get('.modal-body .form-control[data-fieldname="field"]').first().select('Due Date').wait(200);
		cy.fill_field('value', '09-28-21', 'Date');

		cy.get('.modal-footer .standard-actions .btn-primary').click();
		cy.wait(500);

		cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
		cy.get('.list-row-container .list-row-checkbox:checked').should('be.visible');
	});

	it('enables "Actions" button', () => {
		const actions = ['Approve', 'Reject', 'Edit', 'Export', 'Assign To', 'Apply Assignment Rule', 'Add Tags', 'Print', 'Delete'];
		cy.go_to_list('ToDo');
		cy.get('.list-row-container:contains("Pending") .list-row-checkbox').click({ multiple: true, force: true });
		cy.get('.actions-btn-group button').contains('Actions').should('be.visible').click();
		cy.get('.dropdown-menu li:visible .dropdown-item').should('have.length', 9).each((el, index) => {
			cy.wrap(el).contains(actions[index]);
		}).then((elements) => {
			cy.intercept({
				method: 'POST',
				url: 'api/method/frappe.model.workflow.bulk_workflow_approval'
			}).as('bulk-approval');
			cy.intercept({
				method: 'POST',
				url: 'api/method/frappe.desk.reportview.get'
			}).as('real-time-update');
			cy.wrap(elements).contains('Approve').click();
			cy.wait(['@bulk-approval', '@real-time-update']);
			cy.wait(300);
			cy.get_open_dialog().find('.btn-modal-close').click();
			cy.reload();
			cy.clear_filters();
			cy.get('.list-row-container:visible').should('contain', 'Approved');
		});
	});
});
{'fraction_non_alphanumeric': 0.24001901140684412, 'fraction_numerical': 0.006891634980988593, 'mean_word_length': 4.71875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3606301', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1441, 'n_words': 198}