Skip to content

Commit

Permalink
cleanup and testing with only 1 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Demian Godon authored and Demian Godon committed Mar 25, 2024
1 parent 150291f commit e6d6ea8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
# run 3 copies of the current job in parallel
containers: [1, 2, 3, 4, 5, 6]
containers: [1]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
17 changes: 5 additions & 12 deletions cypress/e2e/get_bookings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,12 @@ import bookings_helpers from "../utils/bookings_helpers";
describe("Get Bookings spec", () => {
const sampleFName = bookings_generator.generate_firstname();
const sampleLName = bookings_generator.generate_lastname();
const sampleCheckin = new Date();
const sampleCheckinStr = "2025-06-07"; // bookings_helpers.convertToBookingDateString(sampleCheckin);
const sampleCheckout = new Date();
const sampleCheckoutStr = "2024-06-17"; // bookings_helpers.convertToBookingDateString(sampleCheckout);
let newbooking;
let checkinMinus1Str;

before(() => {
newbooking = bookings_generator.generate_booking();
newbooking.firstname = sampleFName;
newbooking.lastname = sampleLName;
let checkinMinus1 = new Date(newbooking.bookingdates.checkin);
checkinMinus1.setDate(checkinMinus1.getDate() - 1);
checkinMinus1Str =
bookings_helpers.convertToBookingDateString(checkinMinus1);
cy.log("checkinMinus1Str: " + checkinMinus1Str);
// newbooking.bookingdates.checkin = sampleCheckinStr;
// newbooking.bookingdates.checkout = sampleCheckoutStr;
bookings_wrapper.create_booking(newbooking);
});

Expand Down Expand Up @@ -61,6 +49,11 @@ describe("Get Bookings spec", () => {
});

it("Get Booking by Checkin", () => {
// workaround for fact that restful booker saves dates off by one
let checkinMinus1 = new Date(newbooking.bookingdates.checkin);
checkinMinus1.setDate(checkinMinus1.getDate() - 1);
let checkinMinus1Str =
bookings_helpers.convertToBookingDateString(checkinMinus1);
bookings_wrapper
.get_booking_by({ checkin: checkinMinus1Str })
.then((response) => {
Expand Down

0 comments on commit e6d6ea8

Please sign in to comment.