Leave a Comment
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):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
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)), ) |
Similar Posts
LEAVE A COMMENT
Для отправки комментария вам необходимо авторизоваться.