E2E tests in go

I tried it via ginkgo and gomega.

It has Agouti with WebDriver support out of the box, but I didn’t use it as we have grpc API.

That’s the example (table tests):


var _ = Describe("GetRoute", func() {
	var (
		srClient sr.Client
		srErr    error
	)

	JustBeforeEach(func() {
		srClient, srErr = GetClient()
	})

	DescribeTable("positive cases",
		func(fromGeoPointID, toGeoPointID int, expectedUID string, expectedCostGreaterThan float64) {
			Expect(srErr).NotTo(HaveOccurred())
			Expect(srClient).NotTo(BeNil())

			response, err := srClient.GetRoute(context.TODO(), &sr.GetRouteRequest{
				FromGeoPointId: int64(fromGeoPointID),
				ToGeoPointId:   int64(toGeoPointID),
				Quantity:       1,
				Volume:         1,
				Weight:         1,
			})

			Expect(err).To(Succeed())
			Expect(response).NotTo(BeNil())
			Expect(response.RouteCost).NotTo(BeNil())
			Expect(response.RouteCost.RouteUid).To(HaveSuffix(expectedUID))
			Expect(response.RouteCost.GetCost()).To(BeNumerically(">", expectedCostGreaterThan))
		},
		Entry("from(geo=3)->to(geo=2)", 3, 2, "-3-2", float64(10)),
	)

LEAVE A COMMENT