Skip to content

Commit

Permalink
Merge branch 'master' into forenta/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome-Roy committed Nov 25, 2024
2 parents 15ba650 + 032e061 commit 3beec4c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: 'Linter'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1

Expand All @@ -20,13 +20,13 @@ jobs:
name: 'Selenium tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
architecture: x64

- name: 'Install dependencies'
Expand Down
8 changes: 6 additions & 2 deletions mb-edit-create_from_wikidata.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class WikiDataHelpers {
idMyspace: 'P3265',
idWeibo: 'P3579',
idPinterest: 'P3836',
idThreads: 'P11892',
// other
idSpotify: 'P1902',
idYoutube: 'P2397',
Expand All @@ -112,6 +113,7 @@ class WikiDataHelpers {
idSongkick: 'P3478',
idVimeo: 'P4015',
idPatreon: 'P4175',
idAnghami: 'P10885',
// missing: Tumblr (P3943), Bandcamp (P3283)
};
this.urls = {
Expand Down Expand Up @@ -145,6 +147,7 @@ class WikiDataHelpers {
idMyspace: 'https://myspace.com/',
idWeibo: 'https://weibo.com/',
idPinterest: 'https://www.pinterest.com/',
idThreads: 'https://www.threads.net/@',
// other
idSpotify: 'https://open.spotify.com/artist/',
idYoutube: 'https://www.youtube.com/channel/',
Expand All @@ -160,6 +163,7 @@ class WikiDataHelpers {
idSongkick: 'https://www.songkick.com/artists/',
idVimeo: 'https://vimeo.com/',
idPatreon: 'https://www.patreon.com/',
idAnghami: 'https://play.anghami.com/artist/',
};
}

Expand Down Expand Up @@ -358,8 +362,8 @@ function setValue(nodeId, value, callback) {

function fillISNI(isni) {
const existing_isni = [];
const isniBlock = document.getElementsByClassName(
'edit-artist.isni_codes-template')[0].parentElement;
const isniBlock = document.getElementById(
'add-isni-code').parentElement.parentElement;
const fields = isniBlock.getElementsByTagName('input');
for (const input of fields) {
existing_isni.push(input.value.split(' ').join(''));
Expand Down
3 changes: 3 additions & 0 deletions tests/test_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time
import unittest

import pytest
from selenium.webdriver.support.ui import Select

from tests import UserscriptsTC
Expand Down Expand Up @@ -40,6 +41,7 @@ def test_script_set_video(self):
# time.sleep(1)
# assert 'Fetching required data' in self.driver.page_source

@pytest.mark.skip(reason="external link already exists")
def test_script_wikidata(self):
self.login('artist', ARTIST_MBID + '/edit')
self.load_userscript('mb-edit-create_from_wikidata.user.js')
Expand Down Expand Up @@ -75,6 +77,7 @@ def test_script_set_aliases(self):
assert self.driver.find_element_by_css_selector(
'tr.newAlias select').get_attribute('selectedIndex') == '0'

@pytest.mark.skip(reason="async releditor")
def test_script_edit_subworks(self):
self.login('work', WORK_WITH_SW_MBID + '/edit')
self.load_userscript('mb-edit-edit_subworks.user.js')
Expand Down
15 changes: 15 additions & 0 deletions tests/test_reledit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time
import unittest

import pytest
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoAlertPresentException

Expand All @@ -25,6 +26,7 @@

class ReleditUserscriptsTC(UserscriptsTC):

@pytest.mark.skip(reason="")
def test_script_clone_ext_relations(self):
self.login('release', RELEASE_WO_WORKS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-clone_relations.user.js')
Expand All @@ -41,6 +43,7 @@ def test_script_clone_ext_relations(self):
'td.recording').text
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_clone_ext_recording_relations(self):
self.login('release', RELEASE_WO_WORKS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-clone_relations.user.js')
Expand All @@ -55,6 +58,7 @@ def test_script_clone_ext_recording_relations(self):
assert len(self.driver.find_elements_by_class_name('rel-add')) > 1
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_clone_recording_relations(self):
self.login('release', RELEASE_W_RECRELS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-clone_relations.user.js')
Expand All @@ -69,6 +73,7 @@ def test_script_clone_recording_relations(self):
assert len(self.driver.find_elements_by_class_name('rel-add')) > 1
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_clone_multi_sources(self):
self.login('release', RELEASE_W_RECRELS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-clone_relations.user.js')
Expand Down Expand Up @@ -122,6 +127,7 @@ def test_script_clone_GH_28(self):
assert self.driver.page_source.count('sampled by') == count_backward + 1
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_remove_dates(self):
self.login('release', RELEASE_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-copy_dates.user.js')
Expand All @@ -133,6 +139,7 @@ def test_script_remove_dates(self):
assert 'on 2016-04-07' not in self.driver.page_source
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_copy_dates(self):
self.login('release', RELEASE_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-copy_dates.user.js')
Expand All @@ -151,6 +158,7 @@ def test_script_copy_dates(self):
assert self.driver.page_source.count('on 2016-04-07') > 1
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_guess_works(self):
self.login('release', RELEASE_WO_WORKS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-guess_works.user.js')
Expand All @@ -164,6 +172,7 @@ def test_script_guess_works(self):
assert len(self.driver.find_elements_by_css_selector('td.relationship-list span.rel-add')) == 1
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_guess_main_works(self):
self.login('release', RELEASE_WO_WORKS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-guess_works.user.js')
Expand All @@ -178,6 +187,7 @@ def test_script_guess_main_works(self):
assert len(self.driver.find_elements_by_css_selector('td.relationship-list span.rel-add')) == 4
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_guess_repeated_subworks(self):
self.login('release', RELEASE_WO_WORKS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-guess_works.user.js')
Expand Down Expand Up @@ -209,6 +219,7 @@ def test_script_guess_repeated_subworks(self):
assert len(self.driver.find_elements_by_css_selector('td.relationship-list span.rel-add')) == 3
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_guess_overlapping_subworks(self):
self.login('release', RELEASE_WO_WORKS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-guess_works.user.js')
Expand All @@ -231,6 +242,7 @@ def test_script_guess_overlapping_subworks(self):
'td.relationship-list span.rel-add')])
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_release_rels(self):
self.login('release', RELEASE_W_RELS_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-release_rel_to_recording_rel.user.js')
Expand All @@ -244,6 +256,7 @@ def test_script_release_rels(self):
'table.rel-editor-table td.relationship-list span.rel-remove')) == 4
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_set_instruments(self):
self.login('release', RELEASE_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-set_instruments.user.js')
Expand All @@ -262,6 +275,7 @@ def test_script_set_instruments(self):
assert self.driver.page_source.count('remixer') > count_to
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_relation_attrs(self):
self.login('release', RELEASE_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-set_relation_attrs.user.js')
Expand Down Expand Up @@ -290,6 +304,7 @@ def test_script_relation_attrs(self):
assert '(partial)' in self.driver.page_source
assert self.driver.find_element_by_id('edit-note-text').text

@pytest.mark.skip(reason="")
def test_script_set_writer(self):
self.login('release', SMALL_RELEASE_MBID + '/edit-relationships')
self.load_userscript('mb-reledit-set_rec_artist_as_writer.user.js')
Expand Down

0 comments on commit 3beec4c

Please sign in to comment.