adapt E2E/integration tests to endpoint changes

- skip PKP tests (#184)
- Nah.sh, ÖBB, SVV: adapt tests to endpoint changes
- Nah.sh, RSAG, VBN: skip tests due to endpoint changes
- remove dead code

[ci skip]
This commit is contained in:
Jannis R 2020-07-19 16:59:38 +02:00 committed by Jannis Redmann
parent b2a3ce4d66
commit e6f25a6471
8 changed files with 27 additions and 52 deletions

View file

@ -80,11 +80,12 @@ test('journeys  Kiel Hbf to Flensburg', async (t) => {
stopovers: true stopovers: true
}) })
const kaistr = '9049113'
await testJourneysStationToStation({ await testJourneysStationToStation({
test: t, test: t,
res, res,
validate, validate,
fromId: kielHbf, fromIds: [kielHbf, kaistr],
toId: flensburg toId: flensburg
}) })
@ -157,7 +158,8 @@ test('Kiel Hbf to Holstentor', async (t) => {
t.end() t.end()
}) })
test('Husum to Lübeck Hbf with stopover at Kiel Hbf', async (t) => { // todo: fails with "query too complex, try less intermediate stations"
test.skip('Husum to Lübeck Hbf with stopover at Kiel Hbf', async (t) => {
const res = await client.journeys(husum, luebeckHbf, { const res = await client.journeys(husum, luebeckHbf, {
via: kielHbf, via: kielHbf,
results: 1, results: 1,

View file

@ -285,12 +285,16 @@ test('departures with station object', async (t) => {
}) })
test('departures at Karlsplatz in direction of Pilgramgasse', async (t) => { test('departures at Karlsplatz in direction of Pilgramgasse', async (t) => {
const subStops = (await client.stop(wienPilgramgasse, {
subStops: true, entrances: false,
})).stops || []
await testDeparturesInDirection({ await testDeparturesInDirection({
test: t, test: t,
fetchDepartures: client.departures, fetchDepartures: client.departures,
fetchTrip: client.trip, fetchTrip: client.trip,
id: wienKarlsplatz, id: wienKarlsplatz,
directionIds: [wienPilgramgasse, '905002'], directionIds: [wienPilgramgasse, ...subStops.map(s => s.id)],
when, when,
validate validate
}) })

View file

@ -69,7 +69,7 @@ const filharmonia = {
poi: true poi: true
} }
test('journeys Wrocław Główny to Kraków Główny', async (t) => { test.skip('journeys Wrocław Główny to Kraków Główny', async (t) => {
const res = await client.journeys(wrocławGł, krakówGł, { const res = await client.journeys(wrocławGł, krakówGł, {
results: 4, results: 4,
departure: when, departure: when,
@ -89,7 +89,7 @@ test('journeys Wrocław Główny to Kraków Główny', async (t) => {
// todo: via works with detour // todo: via works with detour
// todo: without detour // todo: without detour
test('trip details', async (t) => { test.skip('trip details', async (t) => {
const res = await client.journeys(wrocławGł, krakówGł, { const res = await client.journeys(wrocławGł, krakówGł, {
results: 1, departure: when results: 1, departure: when
}) })
@ -103,7 +103,7 @@ test('trip details', async (t) => {
t.end() t.end()
}) })
test('arrivals at Kraków Główny', async (t) => { test.skip('arrivals at Kraków Główny', async (t) => {
const arrivals = await client.arrivals(krakówGł, { const arrivals = await client.arrivals(krakówGł, {
duration: 10, when duration: 10, when
}) })
@ -116,7 +116,7 @@ test('arrivals at Kraków Główny', async (t) => {
t.end() t.end()
}) })
test('nearby', async (t) => { test.skip('nearby', async (t) => {
const nearby = await client.nearby(dworcowa100, { distance: 500 }) const nearby = await client.nearby(dworcowa100, { distance: 500 })
validate(t, nearby, 'locations', 'nearby') validate(t, nearby, 'locations', 'nearby')
@ -127,7 +127,7 @@ test('nearby', async (t) => {
t.end() t.end()
}) })
test('radar', async (t) => { test.skip('radar', async (t) => {
const vehicles = await client.radar({ const vehicles = await client.radar({
north: 48.74453, north: 48.74453,
west: 11.42733, west: 11.42733,
@ -141,7 +141,7 @@ test('radar', async (t) => {
t.end() t.end()
}) })
test('reachableFrom', async (t) => { test.skip('reachableFrom', async (t) => {
await testReachableFrom({ await testReachableFrom({
test: t, test: t,
reachableFrom: client.reachableFrom, reachableFrom: client.reachableFrom,

View file

@ -105,7 +105,8 @@ test.skip('radar', async (t) => {
t.end() t.end()
}) })
test('reachableFrom', async (t) => { // todo: fails with "HCI Service: location missing or invalid"
test.skip('reachableFrom', async (t) => {
await testReachableFrom({ await testReachableFrom({
test: t, test: t,
reachableFrom: client.reachableFrom, reachableFrom: client.reachableFrom,

View file

@ -143,40 +143,7 @@ test.skip('journeys: via works with detour', async (t) => {
t.end() t.end()
}) })
test.skip('journeys: via works without detour', async (t) => { // todo: journeys: via works without detour
// When going from Karlsplatz to Praterstern via Museumsquartier, there is
// *no need* to change trains / no need for a "detour".
const karlsplatz = '1390461'
const praterstern = '1290201'
const museumsquartier = '1390171'
const museumsquartierPassed = '901014'
const res = await client.journeys(karlsplatz, praterstern, {
via: museumsquartier,
results: 1,
departure: when,
stopovers: true
})
validate(t, res, 'journeysResult', 'res')
const l1 = res.journeys[0].legs.some((leg) => {
return (
leg.destination.id === museumsquartier ||
leg.destination.id === museumsquartierPassed
)
})
t.notOk(l1, 'transfer at Museumsquartier')
const l2 = res.journeys[0].legs.some((leg) => {
return leg.stopovers && leg.stopovers.some((stopover) => {
return stopover.stop.id === museumsquartierPassed
})
})
t.ok(l2, 'Museumsquartier is not being passed')
t.end()
})
test('earlier/later journeys, Saarbrücken Hbf -> Saarlouis Hbf', async (t) => { test('earlier/later journeys, Saarbrücken Hbf -> Saarlouis Hbf', async (t) => {
await testEarlierLaterJourneys({ await testEarlierLaterJourneys({

View file

@ -31,7 +31,7 @@ const sam = '455086100'
const volksgarten = '455082100' const volksgarten = '455082100'
const zillnerstr2 = { const zillnerstr2 = {
type: 'location', type: 'location',
id: '980133005', id: '980133209',
address: 'Zillnerstraße 2, 5020 Salzburg', address: 'Zillnerstraße 2, 5020 Salzburg',
latitude: 47.801434, longitude: 13.031006, latitude: 47.801434, longitude: 13.031006,
} }
@ -70,7 +70,7 @@ test('trip details', async (t) => {
t.end() t.end()
}) })
test('arrivals at Bremen Humboldtstr.', async (t) => { test('arrivals at Volksgarten', async (t) => {
const arrivals = await client.arrivals(volksgarten, { const arrivals = await client.arrivals(volksgarten, {
duration: 10, when duration: 10, when
}) })

View file

@ -91,13 +91,14 @@ test('radar', async (t) => {
t.end() t.end()
}) })
test('reachableFrom', async (t) => { // todo: fails with "HCI Service: location missing or invalid"
test.skip('reachableFrom', async (t) => {
await testReachableFrom({ await testReachableFrom({
test: t, test: t,
reachableFrom: client.reachableFrom, reachableFrom: client.reachableFrom,
address: { address: {
type: 'location', type: 'location',
id: '910001421', id: '910001453',
name: 'Rathaus, Bremen', name: 'Rathaus, Bremen',
poi: true, poi: true,
latitude: 53.076053, longitude: 8.808008, latitude: 53.076053, longitude: 8.808008,

View file

@ -20,10 +20,10 @@ const when = createWhen('Europe/Berlin', 'de-DE')
const cfg = { const cfg = {
when, when,
products, products,
minLatitude: 51, minLatitude: 50,
maxLatitude: 53, maxLatitude: 54.5,
minLongitude: 9.2, minLongitude: 6.5,
maxLongitude: 10.7 maxLongitude: 11.5,
} }
const validate = createValidate(cfg) const validate = createValidate(cfg)