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
})
const kaistr = '9049113'
await testJourneysStationToStation({
test: t,
res,
validate,
fromId: kielHbf,
fromIds: [kielHbf, kaistr],
toId: flensburg
})
@ -157,7 +158,8 @@ test('Kiel Hbf to Holstentor', async (t) => {
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, {
via: kielHbf,
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) => {
const subStops = (await client.stop(wienPilgramgasse, {
subStops: true, entrances: false,
})).stops || []
await testDeparturesInDirection({
test: t,
fetchDepartures: client.departures,
fetchTrip: client.trip,
id: wienKarlsplatz,
directionIds: [wienPilgramgasse, '905002'],
directionIds: [wienPilgramgasse, ...subStops.map(s => s.id)],
when,
validate
})

View file

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

View file

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

View file

@ -143,40 +143,7 @@ test.skip('journeys: via works with detour', async (t) => {
t.end()
})
test.skip('journeys: via works without detour', async (t) => {
// 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()
})
// todo: journeys: via works without detour
test('earlier/later journeys, Saarbrücken Hbf -> Saarlouis Hbf', async (t) => {
await testEarlierLaterJourneys({

View file

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

View file

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

View file

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