This commit is contained in:
2026-10-18 19:47:31 +07:00
parent 7b8badd140
commit 0152b662a7
10 changed files with 375 additions and 37 deletions
+8 -7
View File
@@ -83,6 +83,7 @@ module.exports = async function onlineSmoke({
game: {
ID: 6,
name: 'HTTP smoke',
status: 'finish',
scenario: { story: invalidStory ? [] : null },
},
})
@@ -250,7 +251,7 @@ module.exports = async function onlineSmoke({
poll(
() => evaluate(`(() => {
const auth = document.querySelectorAll('.n-card-header [data-testid="auth-status"]')
const game = document.querySelectorAll('.n-card-header [data-testid="game-connection-status"]')
const game = document.querySelectorAll('[data-testid="game-control"] [data-testid="game-connection-status"]')
return auth.length === 1 && game.length === 1
&& auth[0].textContent.trim() === '${authenticated ? 'Вход выполнен' : 'Не выполнен'}'
&& game[0].textContent.trim() === '${connected ? 'Подключено' : 'Не подключено'}'
@@ -280,7 +281,7 @@ module.exports = async function onlineSmoke({
'login complete',
)
await evaluate(`Array.from(document.querySelectorAll('button'))
.find(b => b.textContent.trim() === 'Сбросить')?.click()`)
.find(b => b.textContent.trim() === 'Сменить игру')?.click()`)
await poll(
() =>
evaluate(
@@ -291,15 +292,15 @@ module.exports = async function onlineSmoke({
await poll(
() =>
evaluate(
`document.querySelectorAll('main.control > .n-card').length === 3 && document.querySelectorAll('main.control > .game-grid > .n-card').length === 2 && document.querySelectorAll('.n-card-header__main').length === 6`,
`document.querySelectorAll('main.control > .n-card').length === 5 && document.querySelectorAll('[data-testid="game-control"] .n-card').length === 0 && document.querySelectorAll('.n-card-header__main').length === 6`,
),
'six control cards',
'six control cards with merged game controls',
)
assert.deepEqual(
await evaluate(
`Array.from(document.querySelectorAll('.n-card-header__main')).map(e => (e.querySelector('.server-heading > span:first-child') ?? e).textContent.trim())`,
),
['Сервер', 'Игра', 'Экран игры', 'Экран', 'План экранов', 'План музыки'],
['Сервер', 'Материалы', 'Игра', 'Экран', 'План экранов', 'План музыки'],
)
assert.equal(
await evaluate(`document.querySelectorAll('details').length`),
@@ -474,7 +475,7 @@ module.exports = async function onlineSmoke({
await evaluate(`(() => {
const assignment = document.querySelector('[data-testid="sound-assignment"]')
const card = assignment?.closest('.n-card')
return card?.querySelector('.n-card-header__main')?.textContent.trim() === 'Экран игры'
return card?.querySelector('.n-card-header__main')?.textContent.trim() === 'Игра'
&& ['Назначить звук этому экрану', 'Отключиться'].every(label =>
!Array.from(document.querySelectorAll('.n-card')).find(c => c.querySelector('.n-card-header__main')?.textContent.trim() === 'Экран')?.textContent.includes(label))
})()`),
@@ -902,7 +903,7 @@ module.exports = async function onlineSmoke({
'current local game stays visible after logout',
)
const packageKeys = (await evaluate('window.screenBridge.packages()')).map((pkg) => pkg.key)
await evaluate(`Array.from(document.querySelectorAll('button')).find(b => b.textContent.trim() === 'Сбросить').click()`)
await evaluate(`Array.from(document.querySelectorAll('button')).find(b => b.textContent.trim() === 'Сменить игру').click()`)
await poll(
async () => (await state()).catalog.key === null,
'reset clears current game',