Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks #81

Closed
wants to merge 13 commits into from
47 changes: 28 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,31 @@ Mit GUI:
npx cypress open
```

Per Default laufen die Tests gegen den [Ranking1](http://stabikat-ranking1/). Die `searchspecs.yml` befindet sich im Verzeichnis: `/var/www/vufind/local/config/vufind`
Per Default laufen die Tests gegen den [Ranking1](http://stabikat-ranking1/) testserver. Die `searchspecs.yml` befindet sich im Verzeichnis: `/var/www/vufind/local/config/vufind`

### Tagging
Für die Reproduktion der CI Testläufe gegen den produktiven Stabikat z.Bsp der `simple.cs.js` spec:

- Ändere `BASE_URL` zum [Stabikat](https://stabikat.de)
- Spezifiziere welche Testdatei via `--spec`, und
- nur Tests ohne tag, via `--env`

Zur besseren Organisation der Tests via tags:
```bash
CYPRESS_BASE_URL=https://stabikat.de/search/ npx cypress run --spec cypress/e2e/simple.cy.js --env grepUntagged=true
```

- `@next` für Tests die in der Testinstanz laufen, aber noch nicht im produktivem Stabikat
```powershell
npx cypress open --config baseUrl=https://stabikat.de/search/ --env grepUntagged=true
```

Für weitere Optionen siehe [Cypress command-line](https://docs.cypress.io/guides/guides/command-line)

### Tagging

Für offene issues, mit Test die in beiden Instanzen (noch) nicht laufen nutze: `.skip`.
Tests die auf dem Testserver grün sind, aber im produktiven Stabikat rot werden durch den `@next` tag gekennzeichnet:

- `@next`

```js
// This works on test environment but not on stabi
it('CJK author search should return translations', {tags: ['@next']}, () => {
Expand All @@ -102,25 +119,15 @@ Zur besseren Organisation der Tests via tags:
})
```

Wenn die nötigen Änderungen der `searchpsec.yaml` im Stabikat live gegangen sind, müssen die entsprechenden `@next` Tags entfernt werden.

Für Tests die in beiden Instanzen (noch) nicht laufen: `.skip`

Für die Reproduktion der CI Testläufe gegen den produktiven Stabikat der `simple.cs.js` spec:

- Ändere `BASE_URL` zum [Stabikat](https://stabikat.de)
- Spezifiziere welche Testdatei via `--spec`, und
- nur Tests ohne tag, via `--env`
### Release

```bash
CYPRESS_BASE_URL=https://stabikat.de/search/ npx cypress run --spec cypress/e2e/simple.cy.js --env grepUntagged=true
```
Wenn die nötigen Änderungen der `searchpsec.yaml` im Stabikat live gegangen sind, müssen die entsprechenden `@next` Tags entfernt werden. Folgender Befehl führ nur die tests mit tag aus:

```powershell
npx cypress open --config baseUrl=https://stabikat.de/search/ --env grepUntagged=true
```shell
npx cypress run --config baseUrl=https://stabikat.de/search/ --env grepTags=@next
```

Für weitere Optionen siehe [Cypress command-line](https://docs.cypress.io/guides/guides/command-line)
Anschliessend bei allen grünen Tests den Tag entfernen.

## Yaml Prüfung

Expand All @@ -134,6 +141,8 @@ Dieser Test wird auf GitHub automatisch ausgeführt.

## Troubleshooting

Die Datei `cypress/e2e/simple.cy.js` beinhaltet einen Selbsttest. Zur Prolembehebung können diese *unskipped* werden.

### Cypress Browser Warning

Sollte ein eine Browser spezifische Warnung erscheinen, verhindern Windows Systemeinstellungen die automatisierte Nutzung des gewählten Browsers.
Expand Down
16 changes: 6 additions & 10 deletions cypress/e2e/author.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Author Search', () => {
})

// erster Treffer von Autorin
it('first hit should be by the author', {tags: ['@next']}, () => {
it('first hit should be by the author', () => {
cy.get('#result0')
.find('.resultlist-data')
.contains(/(?=.*Karin)(?=.*Glaser)/)
Expand All @@ -32,7 +32,7 @@ describe('Author Search', () => {
})

// see #22
it('CJK author search should return translations', {tags: ['@next']}, () => {
it('CJK author search should return translations', () => {
cy.get('.record-list')
.contains('Yan, Lianke')
})
Expand Down Expand Up @@ -158,18 +158,14 @@ describe('Author Search', () => {
} else {
cy.get($el)
.click()
cy.get('.long-view')
.find('a[id^=description_]')
.click()
cy.get('.additional')
cy.get('.detail-data')
.contains('Heaviside', {matchCase: false})
}

})

}
})
})
})


describe('Elfriede Jelinek', () => {
beforeEach(() => {
cy.visit({
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/chronology.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ describe('Chronology', () => {
})
})

describe('future publication', {tags: ['@next']}, () => {
describe('future publication', () => {
// see #58
// run a query for publications 5 years from noww
beforeEach(() => {
Expand Down
53 changes: 51 additions & 2 deletions cypress/e2e/nested.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Nested Work', () => {
// see #8
describe('African American Review', () => {
describe('African American Review -All', () => {
// Title search and online access false to limit noise
// check if exact match first list item is the journal parent and subsequent entries are child works
// a more elaborate test would compare the value of '.record-number' within the same family
Expand All @@ -9,7 +9,7 @@ describe('Nested Work', () => {
url: '/Results',
qs: {
lookfor: 'African American Review',
type: 'Title',
type: 'allFields',
"filter[]": '~remote_bool:"false"'
}
})
Expand All @@ -25,6 +25,55 @@ describe('Nested Work', () => {
.contains(' Band einer Zeitschrift/Zeitung ')
})
})

describe('African American Review -Journal', () => {
// check if exact match first list item is the journal parent and subsequent entries are child works
// see #75

beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'African American Review',
type: 'JournalSearch',
"filter[]": '~remote_bool:"false"'
}
})
})

it('should appear before child work', () => {
cy.get('#result0')
.find('.media-type')
.contains(' Zeitschrift (gedruckt) ')
cy.get('#result1')
.find('.media-type')
.contains(' Band einer Zeitschrift/Zeitung ')
})
})

describe('African American Review -Title', () => {
// check if exact match first list item is the journal parent and subsequent entries are child works

beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'African American Review',
type: 'title',
"filter[]": '~remote_bool:"false"'
}
})
})

it.skip('should appear before child work', () => {
cy.get('#result0')
.find('.media-type')
.contains(' Zeitschrift (gedruckt) ')
cy.get('#result1')
.find('.media-type')
.contains(' Band einer Zeitschrift/Zeitung ')
})
})

describe('Nachrichten Organ Bergbau Hüttenbetrieb', () => {
beforeEach(() => {
Expand Down
60 changes: 20 additions & 40 deletions vufind/searchspecs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,26 +245,15 @@ Author:
- author_os_txtP_mv
DismaxHandler: edismax
DismaxParams:
# - [bq, format:eJournal^237]
# - [bq, format:Journal^284]
# - [bq, format:eBook^255]
# - [bq, format:Book^500]
# - [bq, format:Article^620]
# - [bq, format:"electronic+Article"^620]
# - [bq, format_facet:"Serienband"^0.1]
- [bq, format:eJournal^237]
- [bq, format:Journal^284]
- [bq, format:eBook^255]
- [bq, format:Book^500]
- [bq, format:Article^620]
- [bq, format:"electronic+Article"^620]
- [bq, format_facet:"Serienband"^0.1]

- [bq, publishDateSort:2023^90]
- [bq, publishDateSort:2022^80]
- [bq, publishDateSort:2021^70]
- [bq, publishDateSort:2020^60]
- [bq, publishDateSort:2019^50]
- [bq, publishDateSort:2018^45]
- [bq, publishDateSort:2017^40]
- [bq, publishDateSort:2016^35]
- [bq, publishDateSort:2015^30]
- [bq, publishDateSort:2014^25]
- [bq, publishDateSort:2013^20]
- [bq, publishDateSort:2024^100]
- [bf, 'ord(publishDateSort)^100']

#Verbesserte Phrasensuche, eWW
QueryFields:
Expand Down Expand Up @@ -329,18 +318,8 @@ Subject:
- [bq, format:"electronic+Article"^620]
- [bq, format_facet:"Serienband"^0.1]

- [bq, publishDateSort:2023^1280]
- [bq, publishDateSort:2022^1260]
- [bq, publishDateSort:2021^1240]
- [bq, publishDateSort:2020^1220]
- [bq, publishDateSort:2019^1200]
- [bq, publishDateSort:2018^1180]
- [bq, publishDateSort:2017^1160]
- [bq, publishDateSort:2016^1150]
- [bq, publishDateSort:2015^1140]
- [bq, publishDateSort:2014^1130]
- [bq, publishDateSort:2013^1120]
- [bq, publishDateSort:202*^1500]
- [bf, 'ord(publishDateSort)^1500']

DismaxHandler: edismax

Keyword:
Expand Down Expand Up @@ -376,6 +355,7 @@ JournalTitle:
DismaxParams:
- [bq,format:Journal^200]
- [bq,format:eJournal^100]
- [bf, 'ord(publishDateSort)^500']
DismaxHandler: edismax
FilterQuery: "format:Journal OR format:eJournal"
# ExactSettings:
Expand Down Expand Up @@ -429,20 +409,20 @@ AllFields:
# - series2^30
- author^200
- author_os_txtP_mv^200
# - authorswithroles_txt_mv^300
- contents^0.01
- authorswithroles_txt_mv^300
# - contents^0.01
- topic_title^150
- topic_unstemmed^150
- topic^150
# - geographic^300
# - class^240
- geographic^300
- class^240
- bklname
- genre
- allfields_unstemmed^0.01
- fulltext_unstemmed^0.01
# - allfields
# - fulltext
- description^0.01
# - allfields_unstemmed^0.01
# - fulltext_unstemmed^0.01
# - allfields^0.01
# - fulltext
# - description^0.01
- isbn
- issn
# - long_lat_display
Expand Down
Loading