Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Add helper function for scheduling in transfer criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanaa committed Aug 2, 2023
1 parent e9bcece commit bb73528
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion cypress/support/fragments/users/transferFeeFine.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Modal, TextField, Select, Pane } from '../../../../interactors';
import { Button, Modal, TextField, Select, Pane, MultiSelect } from '../../../../interactors';

const rootModal = Modal({ id: 'transfer-modal' });
const amountTextfield = rootModal.find(TextField({ id: 'amount' }));
Expand All @@ -22,6 +22,25 @@ export default {
cy.do(Select({ name: 'schedulePeriod' }).choose(period));
},

setTransferCriteriaScheduling(frequency = 'Never (run manually)', interval, time, weekDays) {
cy.do(Select({ name: 'scheduling.frequency' }).choose(frequency));

if (frequency !== 'Never (run manually)') {
cy.do([
Select({ name: 'scheduling.interval' }).choose(interval),
TextField({ name: 'scheduling.time' }).fillIn(time)
]);
}

if (frequency === 'Weekly') {
if (weekDays === undefined) {
cy.do(MultiSelect({ name: 'scheduling.weekDay' }).choose('Monday'));
} else {
weekDays.map((day) => cy.do(MultiSelect({ name: 'scheduling.weekDay' }).choose(day)));
}
}
},

typeScheduleTime(time) {
// time: string like 9:15 AM
cy.do([
Expand Down

0 comments on commit bb73528

Please sign in to comment.