Adding more tests to configuration

This commit is contained in:
Jason House
2020-08-13 22:15:51 +09:00
parent c0e4906bda
commit da53f68c10
6 changed files with 704 additions and 50 deletions
@@ -324,13 +324,15 @@
<label for="telegramBotId">Bot ID</label>
<input type="text" class="form-control" id="telegramBotId" aria-describedby="telegramBotIdHelp"
th:value="${plexProperties?.telegramProperties?.botId}">
<!--<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>-->
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone
else.</small>
</div>
<div class="form-group">
<label for="telegramChatId">Chat ID</label>
<input type="text" class="form-control" id="telegramChatId" aria-describedby="telegramChatIdHelp"
th:value="${plexProperties?.telegramProperties?.chatId}">
<!--<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>-->
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone
else.</small>
</div>
<div class="form-group">
<label>Notification Types</label>
@@ -380,7 +382,8 @@
<select class="form-control" id="telegramEnabled">
<option th:value="false">Disabled
</option>
<option th:value="true" th:selected="${plexProperties?.telegramProperties?.getEnabled() ?: false}">Enabled
<option th:value="true"
th:selected="${plexProperties?.telegramProperties?.getEnabled() ?: false}">Enabled
</option>
</select>
</div>
@@ -404,35 +407,40 @@
<div class="form-group">
<label>Notification Types</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.slackProperties?.hasTmdbConnectionApi()}"
id="slackTmdbApiConnectionNotification">
<label class="form-check-label" for="slackTmdbApiConnectionNotification">
TMDB API Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.slackProperties?.hasPlexServerConnection()}"
id="slackPlexServerConnectionNotification">
<label class="form-check-label" for="slackPlexServerConnectionNotification">
Plex Server Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.slackProperties?.hasPlexMetadataUpdate()}"
id="slackPlexMetadataUpdateNotification">
<label class="form-check-label" for="slackPlexMetadataUpdateNotification">
Plex Metadata Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.slackProperties?.hasPlexLibraryUpdate()}"
id="slackPlexLibraryUpdateNotification">
<label class="form-check-label" for="slackPlexLibraryUpdateNotification">
Plex Library Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.slackProperties?.hasGapsMissingCollections()}"
id="slackGapsMissingCollectionsNotification">
<label class="form-check-label" for="slackGapsMissingCollectionsNotification">
Gaps Missing Collections
@@ -442,8 +450,11 @@
<div class="form-group">
<label for="slackEnabled">Notification Agent</label>
<select class="form-control" id="slackEnabled">
<option>Disabled</option>
<option>Enabled</option>
<option th:value="false">Disabled
</option>
<option th:value="true" th:selected="${plexProperties?.slackProperties?.getEnabled() ?: false}">
Enabled
</option>
</select>
</div>
<div class="form-group">
@@ -475,35 +486,40 @@
<div class="form-group">
<label>Notification Types</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.pushBulletProperties?.hasTmdbConnectionApi()}"
id="pushBulletTmdbApiConnectionNotification">
<label class="form-check-label" for="pushBulletTmdbApiConnectionNotification">
TMDB API Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.pushBulletProperties?.hasPlexServerConnection()}"
id="pushBulletPlexServerConnectionNotification">
<label class="form-check-label" for="pushBulletPlexServerConnectionNotification">
Plex Server Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.pushBulletProperties?.hasPlexMetadataUpdate()}"
id="pushBulletPlexMetadataUpdateNotification">
<label class="form-check-label" for="pushBulletPlexMetadataUpdateNotification">
Plex Metadata Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.pushBulletProperties?.hasPlexLibraryUpdate()}"
id="pushBulletPlexLibraryUpdateNotification">
<label class="form-check-label" for="pushBulletPlexLibraryUpdateNotification">
Plex Library Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.pushBulletProperties?.hasGapsMissingCollections()}"
id="pushBulletGapsMissingCollectionsNotification">
<label class="form-check-label" for="pushBulletGapsMissingCollectionsNotification">
Gaps Missing Collections
@@ -513,10 +529,11 @@
<div class="form-group">
<label for="pushBulletEnabled">Notification Agent</label>
<select class="form-control" id="pushBulletEnabled">
<option th:value="false">
Disabled
<option th:value="false">Disabled
</option>
<option th:value="true" th:selected="${plexProperties?.pushBulletProperties?.getEnabled() ?: false}">Enabled
<option th:value="true"
th:selected="${plexProperties?.pushBulletProperties?.getEnabled() ?: false}">
Enabled
</option>
</select>
</div>
@@ -547,35 +564,40 @@
<div class="form-group">
<label>Notification Types</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.gotifyProperties?.hasTmdbConnectionApi()}"
id="gotifyTmdbApiConnectionNotification">
<label class="form-check-label" for="gotifyTmdbApiConnectionNotification">
TMDB API Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.gotifyProperties?.hasPlexServerConnection()}"
id="gotifyPlexServerConnectionNotification">
<label class="form-check-label" for="gotifyPlexServerConnectionNotification">
Plex Server Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.gotifyProperties?.hasPlexMetadataUpdate()}"
id="gotifyPlexMetadataUpdateNotification">
<label class="form-check-label" for="gotifyPlexMetadataUpdateNotification">
Plex Metadata Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.gotifyProperties?.hasPlexLibraryUpdate()}"
id="gotifyPlexLibraryUpdateNotification">
<label class="form-check-label" for="gotifyPlexLibraryUpdateNotification">
Plex Library Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.gotifyProperties?.hasGapsMissingCollections()}"
id="gotifyGapsMissingCollectionsNotification">
<label class="form-check-label" for="gotifyGapsMissingCollectionsNotification">
Gaps Missing Collections
@@ -585,8 +607,12 @@
<div class="form-group">
<label for="gotifyEnabled">Notification Agent</label>
<select class="form-control" id="gotifyEnabled">
<option>Disabled</option>
<option>Enabled</option>
<option th:value="false">Disabled
</option>
<option th:value="true"
th:selected="${plexProperties?.gotifyProperties?.getEnabled() ?: false}">
Enabled
</option>
</select>
</div>
<div class="form-group">
@@ -659,42 +685,51 @@
<div class="form-group">
<label for="emailSmtpTlsEnabled">SMTP TLS Enabled</label>
<select class="form-control" id="emailSmtpTlsEnabled">
<option>Disabled</option>
<option>Enabled</option>
<option th:value="false">Disabled
</option>
<option th:value="true"
th:selected="${plexProperties?.emailProperties?.getMailSmtpTlsEnabled() ?: false}">
Enabled
</option>
</select>
</div>
<div class="form-group">
<label>Notification Types</label>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.emailProperties?.hasTmdbConnectionApi()}"
id="emailTmdbApiConnectionNotification">
<label class="form-check-label" for="emailTmdbApiConnectionNotification">
TMDB API Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.emailProperties?.hasPlexServerConnection()}"
id="emailPlexServerConnectionNotification">
<label class="form-check-label" for="emailPlexServerConnectionNotification">
Plex Server Connection
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.emailProperties?.hasPlexMetadataUpdate()}"
id="emailPlexMetadataUpdateNotification">
<label class="form-check-label" for="emailPlexMetadataUpdateNotification">
Plex Metadata Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.emailProperties?.hasPlexLibraryUpdate()}"
id="emailPlexLibraryUpdateNotification">
<label class="form-check-label" for="emailPlexLibraryUpdateNotification">
Plex Library Update
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value=""
<input class="form-check-input" type="checkbox"
th:checked="${plexProperties?.emailProperties?.hasGapsMissingCollections()}"
id="emailGapsMissingCollectionsNotification">
<label class="form-check-label" for="emailGapsMissingCollectionsNotification">
Gaps Missing Collections
@@ -704,8 +739,12 @@
<div class="form-group">
<label for="emailEnabled">Notification Agent</label>
<select class="form-control" id="emailEnabled">
<option>Disabled</option>
<option>Enabled</option>
<option th:value="false">Disabled
</option>
<option th:value="true"
th:selected="${plexProperties?.emailProperties?.getEnabled() ?: false}">
Enabled
</option>
</select>
</div>
<div class="form-group">
+195 -12
View File
@@ -10,26 +10,76 @@ describe('Check Email Notification Agent', function () {
let body = resp.body;
expect(body.code).to.eq(122);
expect(body.extras).to.eq(null);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#emailUsername')
.should('have.value', '');
cy.get('#emailPassword')
.should('have.value', '');
cy.get('#emailMailTo')
.should('have.value', '');
cy.get('#emailMailFrom')
.should('have.value', '');
cy.get('#emailServer')
.should('have.value', '');
cy.get('#emailPort')
.should('have.value', '');
cy.get('#emailTransportProtocol')
.should('have.value', '');
cy.get('#emailSmtpAuth')
.should('have.value', '');
cy.get('#emailSmtpTlsEnabled')
.should('have.value', 'false');
cy.get('#emailTmdbApiConnectionNotification')
.should('not.be.checked');
cy.get('#emailPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#emailPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#emailPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#emailGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#emailEnabled')
.should('have.value', 'false');
});
});
it('Set Email Notification Agent Settings', () => {
let object = {
"enabled" : true,
"notificationTypes" : ["TEST"],
"username" : "username",
"password" : "password",
"mailTo" : "mailTo",
"mailFrom" : "mailFrom",
"mailServer": "mailServer",
"mailPort" : 12345,
"mailTransportProtocol" : "mailTransportProtocol",
"mailSmtpAuth" : "mailSmtpAuth",
"mailSmtpTlsEnabled" : true
"enabled": true,
"notificationTypes": ["TEST", "TMDB_API_CONNECTION", "PLEX_SERVER_CONNECTION", "PLEX_METADATA_UPDATE", "PLEX_LIBRARY_UPDATE", "GAPS_MISSING_COLLECTIONS"],
"username": "username",
"password": "password",
"mailTo": "mailTo",
"mailFrom": "mailFrom",
"mailServer": "mailServer",
"mailPort": 12345,
"mailTransportProtocol": "mailTransportProtocol",
"mailSmtpAuth": "mailSmtpAuth",
"mailSmtpTlsEnabled": true
};
cy.request('PUT', '/notifications/email',object)
cy.request('PUT', '/notifications/email', object)
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(120);
@@ -43,7 +93,140 @@ describe('Check Email Notification Agent', function () {
expect(body.extras.password).to.eq("password");
expect(body.extras.mailPort).to.eq(12345);
expect(body.extras.mailSmtpTlsEnabled).to.eq(true);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#emailUsername')
.should('have.value', 'username');
cy.get('#emailPassword')
.should('have.value', 'password');
cy.get('#emailMailTo')
.should('have.value', 'mailTo');
cy.get('#emailMailFrom')
.should('have.value', 'mailFrom');
cy.get('#emailServer')
.should('have.value', 'mailServer');
cy.get('#emailPort')
.should('have.value', '12345');
cy.get('#emailTransportProtocol')
.should('have.value', 'mailTransportProtocol');
cy.get('#emailSmtpAuth')
.should('have.value', 'mailSmtpAuth');
cy.get('#emailSmtpTlsEnabled')
.should('have.value', 'true');
cy.get('#emailTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#emailPlexServerConnectionNotification')
.should('be.checked');
cy.get('#emailPlexMetadataUpdateNotification')
.should('be.checked');
cy.get('#emailPlexLibraryUpdateNotification')
.should('be.checked');
cy.get('#emailGapsMissingCollectionsNotification')
.should('be.checked');
cy.get('#emailEnabled')
.should('have.value', 'true');
});
});
it('Set TMDB Only Email Notification Agent Settings', () => {
let object = {
"enabled": true,
"notificationTypes": ["TMDB_API_CONNECTION"],
"username": "username",
"password": "password",
"mailTo": "mailTo",
"mailFrom": "mailFrom",
"mailServer": "mailServer",
"mailPort": 12345,
"mailTransportProtocol": "mailTransportProtocol",
"mailSmtpAuth": "mailSmtpAuth",
"mailSmtpTlsEnabled": true
};
cy.request('PUT', '/notifications/email', object)
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(120);
expect(body.extras).to.eq(null);
})
.request('/notifications/email')
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(122);
expect(body.extras.username).to.eq("username");
expect(body.extras.password).to.eq("password");
expect(body.extras.mailPort).to.eq(12345);
expect(body.extras.mailSmtpTlsEnabled).to.eq(true);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#emailUsername')
.should('have.value', 'username');
cy.get('#emailPassword')
.should('have.value', 'password');
cy.get('#emailMailTo')
.should('have.value', 'mailTo');
cy.get('#emailMailFrom')
.should('have.value', 'mailFrom');
cy.get('#emailServer')
.should('have.value', 'mailServer');
cy.get('#emailPort')
.should('have.value', '12345');
cy.get('#emailTransportProtocol')
.should('have.value', 'mailTransportProtocol');
cy.get('#emailSmtpAuth')
.should('have.value', 'mailSmtpAuth');
cy.get('#emailSmtpTlsEnabled')
.should('have.value', 'true');
cy.get('#emailTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#emailPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#emailPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#emailPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#emailGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#emailEnabled')
.should('have.value', 'true');
});
});
});
@@ -10,6 +10,35 @@ describe('Check Gotify Notification Agent', function () {
let body = resp.body;
expect(body.code).to.eq(112);
expect(body.extras).to.eq(null);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#gotifyAddress')
.should('have.value', '');
cy.get('#gotifyToken')
.should('have.value', '');
cy.get('#gotifyTmdbApiConnectionNotification')
.should('not.be.checked');
cy.get('#gotifyPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#gotifyPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#gotifyPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#gotifyGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#gotifyEnabled')
.should('have.value', 'false');
});
});
@@ -17,7 +46,7 @@ describe('Check Gotify Notification Agent', function () {
let object = {
"enabled" : true,
"notificationTypes" : ["TEST"],
"notificationTypes" : ["TEST", "TMDB_API_CONNECTION", "PLEX_SERVER_CONNECTION", "PLEX_METADATA_UPDATE", "PLEX_LIBRARY_UPDATE", "GAPS_MISSING_COLLECTIONS"],
"address" : "address",
"token" : "token"
};
@@ -34,7 +63,88 @@ describe('Check Gotify Notification Agent', function () {
expect(body.code).to.eq(112);
expect(body.extras.address).to.eq("address");
expect(body.extras.token).to.eq("token");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#gotifyAddress')
.should('have.value', 'address');
cy.get('#gotifyToken')
.should('have.value', 'token');
cy.get('#gotifyTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#gotifyPlexServerConnectionNotification')
.should('be.checked');
cy.get('#gotifyPlexMetadataUpdateNotification')
.should('be.checked');
cy.get('#gotifyPlexLibraryUpdateNotification')
.should('be.checked');
cy.get('#gotifyGapsMissingCollectionsNotification')
.should('be.checked');
cy.get('#gotifyEnabled')
.should('have.value', 'true');
});
});
it('Set TMDB Only Gotify Notification Agent Settings', () => {
let object = {
"enabled" : true,
"notificationTypes" : ["TMDB_API_CONNECTION"],
"address" : "address",
"token" : "token"
};
cy.request('PUT', '/notifications/gotify',object)
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(110);
expect(body.extras).to.eq(null);
})
.request('/notifications/gotify')
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(112);
expect(body.extras.address).to.eq("address");
expect(body.extras.token).to.eq("token");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#gotifyAddress')
.should('have.value', 'address');
cy.get('#gotifyToken')
.should('have.value', 'token');
cy.get('#gotifyTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#gotifyPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#gotifyPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#gotifyPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#gotifyGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#gotifyEnabled')
.should('have.value', 'true');
});
});
});
@@ -10,6 +10,35 @@ describe('Check PushBullet Notification Agent', function () {
let body = resp.body;
expect(body.code).to.eq(102);
expect(body.extras).to.eq(null);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#pushBulletChannelTag')
.should('have.value', '');
cy.get('#pushBulletAccessToken')
.should('have.value', '');
cy.get('#pushBulletTmdbApiConnectionNotification')
.should('not.be.checked');
cy.get('#pushBulletPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#pushBulletPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#pushBulletPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#pushBulletGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#pushBulletEnabled')
.should('have.value', 'false');
});
});
@@ -17,7 +46,7 @@ describe('Check PushBullet Notification Agent', function () {
let object = {
"enabled" : true,
"notificationTypes" : ["TEST"],
"notificationTypes" : ["TEST", "TMDB_API_CONNECTION", "PLEX_SERVER_CONNECTION", "PLEX_METADATA_UPDATE", "PLEX_LIBRARY_UPDATE", "GAPS_MISSING_COLLECTIONS"],
"channel_tag" : "channel_tag",
"accessToken" : "accessToken"
};
@@ -34,7 +63,88 @@ describe('Check PushBullet Notification Agent', function () {
expect(body.code).to.eq(102);
expect(body.extras.channel_tag).to.eq("channel_tag");
expect(body.extras.accessToken).to.eq("accessToken");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#pushBulletChannelTag')
.should('have.value', 'channel_tag');
cy.get('#pushBulletAccessToken')
.should('have.value', 'accessToken');
cy.get('#pushBulletTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#pushBulletPlexServerConnectionNotification')
.should('be.checked');
cy.get('#pushBulletPlexMetadataUpdateNotification')
.should('be.checked');
cy.get('#pushBulletPlexLibraryUpdateNotification')
.should('be.checked');
cy.get('#pushBulletGapsMissingCollectionsNotification')
.should('be.checked');
cy.get('#pushBulletEnabled')
.should('have.value', 'true');
});
});
it('Set TMDB Only PushBullet Notification Agent Settings', () => {
let object = {
"enabled" : true,
"notificationTypes" : ["TMDB_API_CONNECTION"],
"channel_tag" : "channel_tag",
"accessToken" : "accessToken"
};
cy.request('PUT', '/notifications/pushbullet',object)
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(100);
expect(body.extras).to.eq(null);
})
.request('/notifications/pushbullet')
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(102);
expect(body.extras.channel_tag).to.eq("channel_tag");
expect(body.extras.accessToken).to.eq("accessToken");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#pushBulletChannelTag')
.should('have.value', 'channel_tag');
cy.get('#pushBulletAccessToken')
.should('have.value', 'accessToken');
cy.get('#pushBulletTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#pushBulletPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#pushBulletPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#pushBulletPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#pushBulletGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#pushBulletEnabled')
.should('have.value', 'true');
});
});
});
+101 -1
View File
@@ -10,6 +10,32 @@ describe('Check Slack Notification Agent', function () {
let body = resp.body;
expect(body.code).to.eq(92);
expect(body.extras).to.eq(null);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#slackWebHookUrl')
.should('have.value', '');
cy.get('#slackTmdbApiConnectionNotification')
.should('not.be.checked');
cy.get('#slackPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#slackPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#slackPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#slackGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#slackEnabled')
.should('have.value', 'false');
});
});
@@ -17,7 +43,7 @@ describe('Check Slack Notification Agent', function () {
let object = {
"enabled" : true,
"notificationTypes" : ["TEST"],
"notificationTypes" : ["TEST", "TMDB_API_CONNECTION", "PLEX_SERVER_CONNECTION", "PLEX_METADATA_UPDATE", "PLEX_LIBRARY_UPDATE", "GAPS_MISSING_COLLECTIONS"],
"webHookUrl" : "webHookUrl"
};
@@ -32,7 +58,81 @@ describe('Check Slack Notification Agent', function () {
let body = resp.body;
expect(body.code).to.eq(92);
expect(body.extras.webHookUrl).to.eq("webHookUrl");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#slackWebHookUrl')
.should('have.value', 'webHookUrl');
cy.get('#slackTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#slackPlexServerConnectionNotification')
.should('be.checked');
cy.get('#slackPlexMetadataUpdateNotification')
.should('be.checked');
cy.get('#slackPlexLibraryUpdateNotification')
.should('be.checked');
cy.get('#slackGapsMissingCollectionsNotification')
.should('be.checked');
cy.get('#slackEnabled')
.should('have.value', 'true');
});
});
it('Set TMDB Only Slack Notification Agent Settings', () => {
let object = {
"enabled" : true,
"notificationTypes" : ["TMDB_API_CONNECTION"],
"webHookUrl" : "webHookUrl"
};
cy.request('PUT', '/notifications/slack',object)
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(90);
expect(body.extras).to.eq(null);
})
.request('/notifications/slack')
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(92);
expect(body.extras.webHookUrl).to.eq("webHookUrl");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#slackWebHookUrl')
.should('have.value', 'webHookUrl');
cy.get('#slackTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#slackPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#slackPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#slackPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#slackGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#slackEnabled')
.should('have.value', 'true');
});
});
});
@@ -10,6 +10,35 @@ describe('Check Telegram Notification Agent', function () {
let body = resp.body;
expect(body.code).to.eq(82);
expect(body.extras).to.eq(null);
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#telegramBotId')
.should('have.value', '');
cy.get('#telegramChatId')
.should('have.value', '');
cy.get('#telegramTmdbApiConnectionNotification')
.should('not.be.checked');
cy.get('#telegramPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#telegramPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#telegramPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#telegramGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#telegramEnabled')
.should('have.value', 'false');
});
});
@@ -17,7 +46,7 @@ describe('Check Telegram Notification Agent', function () {
let object = {
"enabled" : true,
"notificationTypes" : ["TEST"],
"notificationTypes" : ["TEST", "TMDB_API_CONNECTION", "PLEX_SERVER_CONNECTION", "PLEX_METADATA_UPDATE", "PLEX_LIBRARY_UPDATE", "GAPS_MISSING_COLLECTIONS"],
"chatId" : "chatId",
"botId" : "botId"
};
@@ -34,7 +63,90 @@ describe('Check Telegram Notification Agent', function () {
expect(body.code).to.eq(82);
expect(body.extras.chatId).to.eq("chatId");
expect(body.extras.botId).to.eq("botId");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#telegramBotId')
.should('have.value', 'botId');
cy.get('#telegramChatId')
.should('have.value', 'chatId');
cy.get('#telegramTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#telegramPlexServerConnectionNotification')
.should('be.checked');
cy.get('#telegramPlexMetadataUpdateNotification')
.should('be.checked');
cy.get('#telegramPlexLibraryUpdateNotification')
.should('be.checked');
cy.get('#telegramGapsMissingCollectionsNotification')
.should('be.checked');
cy.get('#telegramEnabled')
.should('have.value', 'true');
});
});
it('Set TMDB Only Telegram Notification Agent Settings', () => {
let object = {
"enabled" : true,
"notificationTypes" : ["TMDB_API_CONNECTION"],
"chatId" : "chatId",
"botId" : "botId"
};
cy.request('PUT', '/notifications/telegram',object)
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(80);
expect(body.extras).to.eq(null);
})
.request('/notifications/telegram')
.then((resp) => {
let body = resp.body;
expect(body.code).to.eq(82);
expect(body.extras.chatId).to.eq("chatId");
expect(body.extras.botId).to.eq("botId");
})
.visit('/configuration')
.then((resp) => {
cy.get('#notificationTab')
.click();
cy.get('#telegramBotId')
.should('have.value', 'botId');
cy.get('#telegramChatId')
.should('have.value', 'chatId');
cy.get('#telegramTmdbApiConnectionNotification')
.should('be.checked');
cy.get('#telegramPlexServerConnectionNotification')
.should('not.be.checked');
cy.get('#telegramPlexMetadataUpdateNotification')
.should('not.be.checked');
cy.get('#telegramPlexLibraryUpdateNotification')
.should('not.be.checked');
cy.get('#telegramGapsMissingCollectionsNotification')
.should('not.be.checked');
cy.get('#telegramEnabled')
.should('have.value', 'true');
});
});
});